RFR: 8276663: Cleanup NMT AccessLock [v2]

David Holmes dholmes at openjdk.java.net
Fri Nov 5 03:51:11 UTC 2021


On Fri, 5 Nov 2021 02:15:33 GMT, Zhengyu Gu <zgu at openjdk.org> wrote:

>> Please review this cleanup patch to NMT AccessLock:
>> 
>> * Make LockState enum private, no external use.
>> * const lock location pointer
>> * Use memory_order_relaxed for lock counter updates.
>> 
>> Test:
>> - [x] hotspot_nmt on x86_64 and aarch64
>
> Zhengyu Gu has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Uses Atomic::load()

Hi Zhengyu,

I do not understand this change. The "counter" is what makes the lock acts as a lock. Locks generally require acquire/release semantics wrt. to the locking and unlocking around a critical section. So how can you switch to use mo_relaxed?

David

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

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


More information about the hotspot-runtime-dev mailing list