RFR: 8304824: NMT should not use ThreadCritical [v8]

Robert Toyonaga duke at openjdk.org
Mon Oct 28 15:49:22 UTC 2024


On Fri, 25 Oct 2024 14:23:29 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:

>> Robert Toyonaga has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Update src/hotspot/share/utilities/vmError.cpp
>>   
>>   Co-authored-by: David Holmes <62092539+dholmes-ora at users.noreply.github.com>
>
> src/hotspot/share/runtime/mutexLocker.cpp line 299:
> 
>> 297:   MUTEX_DEFN(ThreadsSMRDelete_lock           , PaddedMonitor, service-2); // Holds ConcurrentHashTableResize_lock
>> 298:   MUTEX_DEFN(ThreadIdTableCreate_lock        , PaddedMutex  , safepoint);
>> 299:   MUTEX_DEFN(SharedDecoder_lock              , PaddedMutex  , service-5);
> 
> Why this? Do we print stacks under NMT lock protection?

Yes I think so. `MemTracker::print_containing_region` first acquires the  NMT lock then the `SharedDecoder_lock` like this:

`MemTracker::print_containing_region` -->
`PrintRegionWalker::do_allocation_site` -->
`NativeCallStack::print_frame` --> 
`Decoder::get_source_info` --> 
`Decoder::shared_decoder_lock()`

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

PR Review Comment: https://git.openjdk.org/jdk/pull/20852#discussion_r1819307026


More information about the serviceability-dev mailing list