RFR: 8273217: Make ParHeapInspectTask _safepoint_check_never

Coleen Phillimore coleenp at openjdk.java.net
Wed Sep 1 11:35:45 UTC 2021


On Wed, 1 Sep 2021 06:28:36 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> Make lock be declared as safepoint_check_never.
>> Ran tier1-3 tests and test that uses this code: serviceability/dcmd/gc/ClassHistogramTest.java
>
> src/hotspot/share/memory/heapInspection.cpp line 564:
> 
>> 562:   missed_count = ric.missed_count();
>> 563:   {
>> 564:     MutexLocker x(&_mutex, Mutex::_no_safepoint_check_flag);
> 
> This change seems unnecessary - this lock is only taken by GC threads, or the VMThread (?), never a JavaThread, but this change makes it look like it is taken by a JavaThread that wants to avoid safepoint checks.

This change is necessary in that we have a check inside Mutex::lock that this flag matches how the lock was defined.  It was argued that we want to have to pass this parameter to know when safepoints are not checked in the code that was taking out the lock, so the parameter is needed.

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

PR: https://git.openjdk.java.net/jdk/pull/5323


More information about the serviceability-dev mailing list