8374449: Shenandoah: Leaf locks used by Shenandoah need lower ranks

Reviewed-by: ysr
This commit is contained in:
William Kemper 2026-01-30 16:54:47 +00:00
parent c1c543cc81
commit 673cd6ed0c
3 changed files with 7 additions and 4 deletions

View File

@ -44,7 +44,7 @@ ShenandoahControlThread::ShenandoahControlThread() :
ShenandoahController(),
_requested_gc_cause(GCCause::_no_gc),
_degen_point(ShenandoahGC::_degenerated_outside_cycle),
_control_lock(Mutex::nosafepoint - 2, "ShenandoahGCRequest_lock", true) {
_control_lock(CONTROL_LOCK_RANK, "ShenandoahControl_lock", true) {
set_name("Shenandoah Control Thread");
create_and_start();
}

View File

@ -42,6 +42,9 @@ private:
shenandoah_padding(1);
protected:
const Mutex::Rank WAITERS_LOCK_RANK = Mutex::safepoint - 5;
const Mutex::Rank CONTROL_LOCK_RANK = Mutex::nosafepoint - 2;
// While we could have a single lock for these, it may risk unblocking
// GC waiters when alloc failure GC cycle finishes. We want instead
// to make complete explicit cycle for demanding customers.
@ -54,8 +57,8 @@ protected:
public:
ShenandoahController():
_gc_id(0),
_alloc_failure_waiters_lock(Mutex::safepoint-2, "ShenandoahAllocFailureGC_lock", true),
_gc_waiters_lock(Mutex::safepoint-2, "ShenandoahRequestedGC_lock", true)
_alloc_failure_waiters_lock(WAITERS_LOCK_RANK, "ShenandoahAllocFailureWaiters_lock", true),
_gc_waiters_lock(WAITERS_LOCK_RANK, "ShenandoahGCWaiters_lock", true)
{ }
// Request a collection cycle. This handles "explicit" gc requests

View File

@ -47,7 +47,7 @@
#include "utilities/events.hpp"
ShenandoahGenerationalControlThread::ShenandoahGenerationalControlThread() :
_control_lock(Mutex::nosafepoint - 2, "ShenandoahGCRequest_lock", true),
_control_lock(CONTROL_LOCK_RANK, "ShenandoahGCRequest_lock", true),
_requested_gc_cause(GCCause::_no_gc),
_requested_generation(nullptr),
_gc_mode(none),