RFR: 8262519: AArch64: Unnecessary acquire semantics of memory-order-conservative atomics in C++ Hotspot code

Andrew Dinn adinn at openjdk.java.net
Fri Mar 5 11:48:41 UTC 2021


On Wed, 3 Mar 2021 08:07:35 GMT, Dong Bo <dongbo at openjdk.org> wrote:

> For us, we still have servers used by our customers that does not support LSE extension.
> Hm, from our point of view, ldaxr+stlxr+dmb and ldxr+stlxr+dmb provide the same order semantics.
> The acquire are used to ensure all loads/stores that are after an ldaxr (actually loads/stores after the dmb of atomic_*default*_impl in this case) in program order, while the dmb has already guaranteed this for us.
> Without the acquire, the loads/stores after the atomic operations still can not pass the dmb.
Remove the acquire does not change the order between preceding loads/stores and stlxr.

I agree that the code will still be correct if you change the ldaxr to ldar. While this may make some difference on machines which do not support LSE I would not expect it to be significant for anything other than a very carefully crafted benchmark or an extremely specialized parallel algorithm. Is this change request motivated by an actual real-world use case?

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

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


More information about the hotspot-dev mailing list