RFR: 8369622: GlobalChunkPoolMutex needs to be recursive
Johan Sjölen
jsjolen at openjdk.org
Wed Oct 15 12:03:09 UTC 2025
On Sun, 12 Oct 2025 12:55:53 GMT, Johan Sjölen <jsjolen 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.
Afshin's description is correct. It would be preferable to have a recursive mutex in this case, imho. It's unfortunate that we have to implement another type of lock.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/27759#issuecomment-3406046992
More information about the hotspot-runtime-dev
mailing list