RFR: 8369622: GlobalChunkPoolMutex needs to be recursive
Johan Sjölen
jsjolen at openjdk.org
Mon Oct 13 06:47:04 UTC 2025
On Mon, 13 Oct 2025 06:19:42 GMT, David Holmes <dholmes at openjdk.org> wrote:
>> The GlobalChunkPoolMutex replaced ThreadCritical in [JDK-8356173](https://bugs.openjdk.org/browse/JDK-8356173). In NMT, we can unfortunately reach a recursive locking situation in situations when the VM is crashing and NMT attempts to perform a error report. I suggest that we make this particular mutex recursive, until we can resolve the design issues that causes this.
>>
>> This PR also replaces the static initialization with `DeferredStatic`, and fixes the indentation of access modifiers to be consistently 0-indented.
>>
>> Please note that we do not take the lock in NMT in order to allocate memory, but in order to have a "static picture" of the arena counters.
>
> src/hotspot/share/memory/arena.cpp line 49:
>
>> 47:
>> 48: ChunkPoolLocker::ChunkPoolLocker() {
>> 49: assert(GlobalChunkPoolMutex != nullptr, "must be initialized");
>
> Do we have an equivalent assertion to replace this with?
Yes, it's inside of the getter in `DeferredStatic` (so it's "fixed" by the class abstraction)
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/27759#discussion_r2425344502
More information about the hotspot-runtime-dev
mailing list