RFR: 8365147: AArch64: Replace DMB + LD + DMB with LDAR for C1 volatile field loads [v4]
Ruben
duke at openjdk.org
Mon Feb 9 21:33:47 UTC 2026
On Wed, 19 Nov 2025 12:47:18 GMT, Samuel Chee <duke at openjdk.org> wrote:
>> Replaces the DMB ISH + LD + DMB ISHLD sequence with LDAR for volatile field loads - for example, AtomicLong::get.
>>
>> This is valid, as originally the DMBs were necessary due to the case described here - https://bugs.openjdk.org/browse/JDK-8179954. As in the rare case where the LD can be reordered with an LDAR or STLR from the C2 implementation for stores and loads, these DMBs are required.
>> However, acquire/release operations use a sequentially consistent model which does not allow reordering between them. Hence, the LD can be replaced with an LDAR to disallow reordering with a STLR/LDAR and the first DMB can be removed.
>>
>> The LDAR has acquire semantics, so it's impossible for memory accesses after to be reordered before; the DMB ISHLD is not required. Therefore, a singular LDAR is sufficient.
>
> Samuel Chee has updated the pull request incrementally with one additional commit since the last revision:
>
> Rename load_generic -> load_relaxed
I've run java -jar jcstress.jar (revision 1d143cbd430f4cca63a8f0c8c1fad3aabc065421) for this PR with -XX:TieredStopAtLevel=1 combined with -XX:-UseLSE / -XX:+UseLSE.
Result for `-XX:TieredStopAtLevel=1 -XX:+UseLSE`:
Jan 28 00:11:44 Failed tests: No matches.
Jan 28 00:11:44
Jan 28 00:11:44 Error tests: No matches.
Jan 28 00:11:44
Jan 28 00:11:44 All remaining tests: 4957 matching test results. Use -v to print them.
Result for `-XX:TieredStopAtLevel=1 -XX:-UseLSE`:
Jan 29 01:42:26 Failed tests: No matches.
Jan 29 01:42:26
Jan 29 01:42:26 Error tests: No matches.
Jan 29 01:42:26
Jan 29 01:42:26 All remaining tests: 4948 matching test results. Use -v to print them.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/26748#issuecomment-3826140658
More information about the hotspot-dev
mailing list