RFR: 8273917: Remove 'leaf' ranking for Mutex [v2]

Coleen Phillimore coleenp at openjdk.java.net
Tue Oct 5 13:31:10 UTC 2021


On Mon, 4 Oct 2021 14:10:29 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:

>> This change removes 'leaf' ranking.  The previous change for JDK-8273915 divided the 'leaf' ranked locks that didn't safepoint check into the rank 'nosafepoint', so all the 'leaf' ranking locks left were safepoint_check_always.
>> 
>> The rank 'nonleaf' (to be renamed 'safepoint' in the next change) is the *top* mutex rank.
>> 
>> The transformation in this change is as follows:
>>    nonleaf+n   => nonleaf   - Generally these 'nonleaf' mutex were top level locks)
>>    leaf => nonleaf                - Many of these locks were top level locks
>>    leaf => nonleaf-2             - Assuming that they were 'leaf' and 2 levels less than some existing nonleaf lock
>>    leaf-n => nonleaf-n
>> 
>> The new mutex rankings reflect their rankings based on my logging, except for a couple shenandoah locks which I didn't observe, so I made them nonleaf-2.
>> 
>> This change also introduces a relative mutex ranking macro, so that a Mutex/Monitor can be defined in terms of a mutex that it holds while trying to acquire it.  So these relative mutex are moved to the end of the init function in mutexLocker.cpp.
>> 
>> This has been tested with tier1-8, and retesting tier1-3 locally in progress.
>
> Coleen Phillimore has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Fix Minimal build.

According to my logging, the shenandoah locks don't have any dependencies when running runThese with shenandoah, but could someone confirm this is ok to make them nonleaf? @zhengyu123 ?
$ grep -r ShenandoahAllocFailureGC_lock
38_ShenandoahAllocFailureGC_lock:def(ShenandoahAllocFailureGC_lock , PaddedMonitor, nonleaf, _safepoint_check_always, true);
$ grep -r ShenandoahRequestedGC_lock
38_ShenandoahRequestedGC_lock:def(ShenandoahRequestedGC_lock    , PaddedMonitor, nonleaf, _safepoint_check_always, true);

_wait_monitor (should rename to a consistent lock name) depends on PeriodicTask_lock:
$ grep -r PeriodicTask_lock
38_PeriodicTask_lock:def(PeriodicTask_lock             , PaddedMonitor, nonleaf, _safepoint_check_always, true);
37__wait_monitor:def(_wait_monitor                 , PaddedMonitor, PeriodicTask_lock, _safepoint_check_always, true);

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

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


More information about the shenandoah-dev mailing list