RFR: 8277990: NMT: Remove NMT shutdown capability

Zhengyu Gu zgu at openjdk.java.net
Thu Dec 2 15:55:25 UTC 2021


On Thu, 2 Dec 2021 15:43:58 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:

> > You are talking about AccessLock, right?
> 
> > As @dholmes-ora mentioned in PR #6267, the name is misleading: it is not a lock, but a countdown latch. It allows multi-reader to access MallocSiteTable, but once an exclusive access is requested, the requester sets counter to negative number and waits all readers to exit, then no readers and writers are allowed, so that MallocSiteTable can be safely destroyed.
> 
> > AccessLock was invented to guard MallocSiteTable, as ThreadCritical is too expensive for malloc tracking.
> 
> Just to see I get it right, AccessLock is not needed anymore because we don't destroy the MallocSiteTable? We don't need it to guard the table when we add callstacks?

Yes. Ironically, adding entry only requires shared access, it uses `CAS` to ensure table integrity :-) If we don't destroy the table, there is no requester for exclusive access, so it is no longer needed.

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

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


More information about the hotspot-dev mailing list