On Thu, 18 May 2023 13:56:06 GMT, Paul Hohensee <p...@openjdk.org> wrote:
>> Changed. Not sure atomic load is needed. > > Even though this version passed the pre-submit tests, which include the new > versions of ThreadAllocatedBytes.java, running it more often on a host with > many hardware threads resulted in failures where getTotalAllocatedBytes did > not monotonically increase. I believe what happened was that without an > acquire/release, the hardware can float earlier stores to > _exited_allocated_bytes above later ones. Adding acquire/release fixed the > issue. That should not be possible if the update is always under the lock. acquire/release control what other memory updates you see when you see "this" update - they have no affect on the update itself. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/13814#discussion_r1198492860