RFR: 8304824: NMT should not use ThreadCritical

Thomas Stuefe stuefe at openjdk.org
Fri Sep 6 10:39:52 UTC 2024


On Thu, 5 Sep 2024 21:10:27 GMT, Robert Toyonaga <duke at openjdk.org> wrote:

>> ### Summary
>> This PR just replaces `ThreadCritical` with a lock specific to NMT.  `ThreadCritical` is a big lock and is unnecessary for the purposes of NMT. I've implemented the new lock with a semaphore so that it can be used early before VM init.  There is also the possibility of adding assertions in places we expect NMT to have synchronization. I haven't added assertions yet in many places because some code paths such as the (NMT tests)  don't lock yet. I think it makes sense to close any gaps in locking in another PR in which I can also add more assertions. 
>> 
>> Testing:
>> - hotspot_nmt
>> - gtest:VirtualSpace
>> - tier1
>
> The GHA `macos-aarch64 / test - Test (tier1) `  is failing due to `TEST: runtime/cds/DeterministicDump.java`  with the message `java.lang.RuntimeException: File content different at byte #4, b0 = -126, b1 = -52`. 
> But I don't think it's related to the changes in this PR.  It also looks like this test is failing on other recent PRs.

@roberttoyonaga Why don't we use a normal hotspot mutex here?

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

PR Comment: https://git.openjdk.org/jdk/pull/20852#issuecomment-2333772859


More information about the serviceability-dev mailing list