RFR: 8369622: GlobalChunkPoolMutex is recursively locked during error handling
Coleen Phillimore
coleenp at openjdk.org
Mon Oct 20 12:25:58 UTC 2025
On Mon, 20 Oct 2025 00:03:36 GMT, David Holmes <dholmes at openjdk.org> wrote:
>> This change disables recursive locking for the ChunkPoolLocker during error handling for NMT callers. The patch is written by Johan as an alternative to supporting another recursive locker for this lock.
>> Tested with tier1-4, tier5 on aarch64 (product and debug).
>
> src/hotspot/share/nmt/mallocTracker.cpp line 71:
>
>> 69: if (VMError::is_error_reported() && VMError::is_error_reported_in_current_thread()) {
>> 70: ls = ChunkPoolLocker::LockStrategy::Try;
>> 71: }
>
> Thinking more, we could simply always do this check in the constructor and do away with the "strategy" flag altogether. Arguably this would be reasonable behaviour for every Mutexlocker (though it may slow things down a little).
I had a version that did this but Johan was worried about global behavior so wanted to limit it to just NMT reporting on error to be safe.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/27869#discussion_r2444858287
More information about the hotspot-runtime-dev
mailing list