RFR: 8360654: AArch64: Remove redundant dmb from C1 compareAndSet [v2]

Samuel Chee duke at openjdk.org
Tue Aug 19 15:06:45 UTC 2025


On Tue, 19 Aug 2025 12:52:39 GMT, Samuel Chee <duke at openjdk.org> wrote:

>>> My proposal is:
>>> 
>>>     1. For `cmpxchg`, we add a trailingDMB option, and emit if `!useLSE && trailingDMB`, moving the dmbs from outside to inside the method. Have default value for trailingDMB be false so other call sites won't emit this dmb hence won't be affected.
>> 
>> I think it would be better to refactor things so that the intent is clear. better have `cmpxchg_barrier` and use that for C1.
>> 
>>>     2. In a separate ticket, `cmpxchgptr` and `cmpxchgw` already have DMBs inside their method definitions, so add extra trailingDMB parameter defaulted to true. And emit dmb if true.
>> 
>> Likewise.
>> 
>>>     3. In a separate ticket, apply same logic to `atomic_##NAME` to move DMB inside function and default trailingDMB to false to not affect other call sites.
>> 
>> Likewise.
>
> Have just addressed for this PR, should have one for cmpxchgptr up shortly in a seperate pr.

Related: https://github.com/openjdk/jdk/pull/26845

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

PR Review Comment: https://git.openjdk.org/jdk/pull/26000#discussion_r2285560233


More information about the hotspot-compiler-dev mailing list