RFR: 8272788: Nonleaf ranked locks should not be safepoint_check_never [v3]

Patricio Chilano Mateo pchilanomate at openjdk.java.net
Wed Sep 1 17:39:33 UTC 2021


On Tue, 31 Aug 2021 21:52:12 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:

>> I moved nonleaf ranked locks to be leaf (or leaf+something).  Many of the leaf locks are safepoint_check_never.  Segregating this rank into safepoint checking and non-safepoint checking is left for a future RFE.
>> Tested with tier1-3.  Tier 4-6 testing in progress.
>
> Coleen Phillimore has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains four commits:
> 
>  - Fix merge error.
>  - Merge branch 'master' into nonleaf
>  - Remove JfrSream_lock and rerun JFR tests.
>  - 8272788: Nonleaf ranked locks should not be safepoint_check_neve

Hi Coleen,

Changes look good to me. By inspecting the calls made after acquiring locks JvmtiTagMap_lock, CompiledIC_lock and VtableStubs_lock it seems the new lower rank of these locks should be fine although it's not straightforward. I guess we can always fix it if we find some path where a higher order rank needs to be acquired, but at least we know all the special locks are still lower than leaf. Only comment about NonJavaThreadsList_lock.

Thanks,
Patricio

src/hotspot/share/runtime/mutexLocker.cpp line 270:

> 268: 
> 269:   def(Threads_lock                 , PaddedMonitor, barrier,     true,  _safepoint_check_always);  // Used for safepoint protocol.
> 270:   def(NonJavaThreadsList_lock      , PaddedMutex,   leaf+1,      true,  _safepoint_check_never);

Why do we need to change this rank? We now assert a lock should be _safepoint_check_always if the rank is >= nonleaf, but this is barrier so it should be good.

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

Marked as reviewed by pchilanomate (Committer).

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


More information about the serviceability-dev mailing list