RFR: 8369622: GlobalChunkPoolMutex is recursively locked during error handling
Coleen Phillimore
coleenp at openjdk.org
Tue Oct 21 12:42:12 UTC 2025
On Tue, 21 Oct 2025 11:15:57 GMT, Paul Hübner <phubner 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/memory/arena.cpp line 52:
>
>> 50: GlobalChunkPoolMutex->lock();
>> 51: _locked = true;
>> 52: } else {
>
> Possible enhancement: explicitly check for `Try` and then `ShouldNotReachHere` in the else case. I'm not sure if this is necessary for a bandaid fix like this, though.
I suppose I could add it. The enum only has two choices so it seems like overkill though.
> src/hotspot/share/memory/arena.hpp line 41:
>
>> 39:
>> 40: class ChunkPoolLocker : public StackObj {
>> 41: public:
>
> Nitpick FYI: I think the new `public` has a different indentation than the old one. Just wanted to point it out, is this something that should be addressed? I do not have an opinion on the topic.
For some reason, much of the code I've seen has one space for access modifiers, so I'm going to stick with that.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/27869#discussion_r2448048308
PR Review Comment: https://git.openjdk.org/jdk/pull/27869#discussion_r2448046305
More information about the hotspot-runtime-dev
mailing list