8371409: Wrong lock ordering between FullGCALot_lock and ThreadsLockThrottle_lock/MethodCompileQueue_lock

Reviewed-by: rehn, pchilanomate
This commit is contained in:
Coleen Phillimore 2025-12-04 22:34:42 +00:00
parent c8b30da7ef
commit 6db1c4f5b9
2 changed files with 3 additions and 3 deletions

View File

@ -544,7 +544,7 @@ void Universe::genesis(TRAPS) {
// Only modify the global variable inside the mutex.
// If we had a race to here, the other dummy_array instances
// and their elements just get dropped on the floor, which is fine.
MutexLocker ml(THREAD, FullGCALot_lock);
MutexLocker ml(THREAD, FullGCALot_lock, Mutex::_no_safepoint_check_flag);
if (_fullgc_alot_dummy_array.is_empty()) {
_fullgc_alot_dummy_array = OopHandle(vm_global(), dummy_array());
}
@ -1458,7 +1458,7 @@ uintptr_t Universe::verify_mark_bits() {
#ifdef ASSERT
// Release dummy object(s) at bottom of heap
bool Universe::release_fullgc_alot_dummy() {
MutexLocker ml(FullGCALot_lock);
MutexLocker ml(FullGCALot_lock, Mutex::_no_safepoint_check_flag);
objArrayOop fullgc_alot_dummy_array = (objArrayOop)_fullgc_alot_dummy_array.resolve();
if (fullgc_alot_dummy_array != nullptr) {
if (_fullgc_alot_dummy_next >= fullgc_alot_dummy_array->length()) {

View File

@ -244,7 +244,7 @@ void mutex_init() {
MUTEX_DEFN(SymbolArena_lock , PaddedMutex , nosafepoint);
MUTEX_DEFN(ExceptionCache_lock , PaddedMutex , safepoint);
#ifndef PRODUCT
MUTEX_DEFN(FullGCALot_lock , PaddedMutex , safepoint); // a lock to make FullGCALot MT safe
MUTEX_DEFN(FullGCALot_lock , PaddedMutex , nosafepoint); // a lock to make FullGCALot MT safe
#endif
MUTEX_DEFN(BeforeExit_lock , PaddedMonitor, safepoint);