RFR: 8253183: Fragile memory barrier selection for some weak memory model platforms

Daniel D.Daugherty dcubed at openjdk.java.net
Tue Sep 29 17:36:20 UTC 2020


On Mon, 28 Sep 2020 21:11:04 GMT, Martin Doerr <mdoerr at openjdk.org> wrote:

> Hi, I'd like to propose a fix after the discussion in https://bugs.openjdk.java.net/browse/JDK-8253183
> 
> Please especially review my new comments in the code. The authors of the surrounding code in objectMonitor.cpp and
> synchronizer.cpp may know better.

Thumbs up! Your call on whether to switch from 'iriw' to 'IRIW'
in the new function name.

src/hotspot/share/runtime/orderAccess.hpp line 250:

> 248:   // to enforce a globally consistent order of Independent Reads of
> 249:   // Independent Writes. Please use only for such patterns!
> 250:   static void     loadload_for_iriw() {

So why is this (lower case) 'iriw' when we almost always
talk about it as IRIW?

src/hotspot/share/runtime/objectMonitor.cpp line 495:

> 493:   // _contentions and dmw/header may get written by different threads.
> 494:   // Make sure to observe them in the same order when having several observers.
> 495:   OrderAccess::loadload_for_iriw();

The code we are replacing used 'IRIW' instead of 'iriw'.

src/hotspot/share/runtime/synchronizer.cpp line 1111:

> 1109:         // dmw/header and _contentions may get written by different threads.
> 1110:         // Make sure to observe them in the same order when having several observers.
> 1111:         OrderAccess::loadload_for_iriw();

The code we're replacing using 'IRIW' instead of 'iriw'.

-------------

PR: https://git.openjdk.java.net/jdk/pull/387


More information about the hotspot-dev mailing list