RFR: Use timed wait to sleep control thread [v2]
earthling-amzn
github.com+71722661+earthling-amzn at openjdk.java.net
Thu Apr 8 16:36:59 UTC 2021
On Thu, 8 Apr 2021 06:26:22 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:
>> earthling-amzn has updated the pull request incrementally with two additional commits since the last revision:
>>
>> - Increase mutex rank of gc waiters
>>
>> This lets us take the control thread's lock to notify it without tripping the deadlock detector.
>> - Remove unnecessary enum namespace
>
> src/hotspot/share/gc/shenandoah/shenandoahControlThread.cpp line 54:
>
>> 52: ConcurrentGCThread(),
>> 53: _alloc_failure_waiters_lock(Mutex::leaf, "ShenandoahAllocFailureGC_lock", true, Monitor::_safepoint_check_always),
>> 54: _gc_waiters_lock(Mutex::safepoint, "ShenandoahRequestedGC_lock", true, Monitor::_safepoint_check_always),
>
> Look at `src/hotspot/share/runtime/mutexLocker.cpp`: if we need to elevate the lock above/below the `leaf`, the usual thing to do is to say `leaf + 1` or `leaf - 1`. I would prefer to make `_control_lock` into `leaf - 1`, as that one is special, not all other locks.
Yes, good call.
-------------
PR: https://git.openjdk.java.net/shenandoah/pull/28
More information about the shenandoah-dev
mailing list