RFR: 8304824: NMT should not use ThreadCritical [v5]
Robert Toyonaga
duke at openjdk.org
Tue Sep 17 22:07:40 UTC 2024
> ### 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
Robert Toyonaga has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains five commits:
- Merge master
- replace tty in pd_release_memory while holding NMT lock.
- Switch to using a Hotspot Mutex.
- Comments. Hide assertion behind DEBUG. Replace MemoryFileTracker locker. make reentrant.
- Replace ThreadCritical with a specific NMT lock
-------------
Changes: https://git.openjdk.org/jdk/pull/20852/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=20852&range=04
Stats: 84 lines in 16 files changed: 34 ins; 21 del; 29 mod
Patch: https://git.openjdk.org/jdk/pull/20852.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/20852/head:pull/20852
PR: https://git.openjdk.org/jdk/pull/20852
More information about the serviceability-dev
mailing list