From 7c40c8af690a238773e3070f16ec640b53581ee4 Mon Sep 17 00:00:00 2001 From: Thomas Schatzl Date: Mon, 20 Feb 2023 10:45:40 +0000 Subject: [PATCH] 8302312: Make ParGCRareEvent_lock G1 specific Reviewed-by: sjohanss, kbarrett --- src/hotspot/share/gc/g1/g1ConcurrentMark.cpp | 2 +- src/hotspot/share/gc/g1/g1OopClosures.inline.hpp | 2 +- src/hotspot/share/gc/g1/g1YoungCollector.cpp | 2 +- src/hotspot/share/gc/g1/heapRegion.cpp | 2 +- src/hotspot/share/runtime/mutexLocker.cpp | 4 ++-- src/hotspot/share/runtime/mutexLocker.hpp | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/hotspot/share/gc/g1/g1ConcurrentMark.cpp b/src/hotspot/share/gc/g1/g1ConcurrentMark.cpp index cd8d37bacbb..cfcdff632e4 100644 --- a/src/hotspot/share/gc/g1/g1ConcurrentMark.cpp +++ b/src/hotspot/share/gc/g1/g1ConcurrentMark.cpp @@ -1398,7 +1398,7 @@ public: cl.archive_regions_removed(), cl.humongous_regions_removed()); { - MutexLocker x(ParGCRareEvent_lock, Mutex::_no_safepoint_check_flag); + MutexLocker x(G1RareEvent_lock, Mutex::_no_safepoint_check_flag); _g1h->decrement_summary_bytes(cl.freed_bytes()); _cleanup_list->add_ordered(&local_cleanup_list); diff --git a/src/hotspot/share/gc/g1/g1OopClosures.inline.hpp b/src/hotspot/share/gc/g1/g1OopClosures.inline.hpp index c9de1d365d9..b1a0c4abc33 100644 --- a/src/hotspot/share/gc/g1/g1OopClosures.inline.hpp +++ b/src/hotspot/share/gc/g1/g1OopClosures.inline.hpp @@ -291,7 +291,7 @@ inline void G1VerifyLiveClosure::do_oop_work(T* p) { bool is_in_heap = _g1h->is_in(obj); if (!is_in_heap || _g1h->is_obj_dead_cond(obj, _vo)) { - MutexLocker x(ParGCRareEvent_lock, Mutex::_no_safepoint_check_flag); + MutexLocker x(G1RareEvent_lock, Mutex::_no_safepoint_check_flag); if (!has_failures()) { log.error("----------"); diff --git a/src/hotspot/share/gc/g1/g1YoungCollector.cpp b/src/hotspot/share/gc/g1/g1YoungCollector.cpp index 3ddf1768d1b..13883085789 100644 --- a/src/hotspot/share/gc/g1/g1YoungCollector.cpp +++ b/src/hotspot/share/gc/g1/g1YoungCollector.cpp @@ -424,7 +424,7 @@ public: G1PrepareRegionsClosure cl(_g1h, this); _g1h->heap_region_par_iterate_from_worker_offset(&cl, &_claimer, worker_id); - MutexLocker x(ParGCRareEvent_lock, Mutex::_no_safepoint_check_flag); + MutexLocker x(G1RareEvent_lock, Mutex::_no_safepoint_check_flag); _all_card_set_stats.add(cl.card_set_stats()); } diff --git a/src/hotspot/share/gc/g1/heapRegion.cpp b/src/hotspot/share/gc/g1/heapRegion.cpp index 42c05efd790..4100bdfad0d 100644 --- a/src/hotspot/share/gc/g1/heapRegion.cpp +++ b/src/hotspot/share/gc/g1/heapRegion.cpp @@ -496,7 +496,7 @@ class VerifyRemSetClosure : public G1VerificationClosure { Log(gc, verify) log; LogStream ls(log.error()); - MutexLocker x(ParGCRareEvent_lock, Mutex::_no_safepoint_check_flag); + MutexLocker x(G1RareEvent_lock, Mutex::_no_safepoint_check_flag); if (!has_failures()) { log.error("----------"); diff --git a/src/hotspot/share/runtime/mutexLocker.cpp b/src/hotspot/share/runtime/mutexLocker.cpp index 9e34f143b51..55cb1efb41b 100644 --- a/src/hotspot/share/runtime/mutexLocker.cpp +++ b/src/hotspot/share/runtime/mutexLocker.cpp @@ -78,11 +78,11 @@ Mutex* NonJavaThreadsListSync_lock = nullptr; Monitor* CGC_lock = nullptr; Monitor* STS_lock = nullptr; Monitor* G1OldGCCount_lock = nullptr; +Mutex* G1RareEvent_lock = nullptr; Mutex* G1DetachedRefinementStats_lock = nullptr; Mutex* MarkStackFreeList_lock = nullptr; Mutex* MarkStackChunkList_lock = nullptr; Mutex* MonitoringSupport_lock = nullptr; -Mutex* ParGCRareEvent_lock = nullptr; Monitor* ConcurrentGCBreakpoints_lock = nullptr; Mutex* Compile_lock = nullptr; Monitor* MethodCompileQueue_lock = nullptr; @@ -359,7 +359,7 @@ void mutex_init() { if (UseG1GC) { defl(G1OldGCCount_lock , PaddedMonitor, Threads_lock, true); - defl(ParGCRareEvent_lock , PaddedMutex , Threads_lock, true); + defl(G1RareEvent_lock , PaddedMutex , Threads_lock, true); } defl(CompileTaskAlloc_lock , PaddedMutex , MethodCompileQueue_lock); diff --git a/src/hotspot/share/runtime/mutexLocker.hpp b/src/hotspot/share/runtime/mutexLocker.hpp index 05c6e69b8c7..64590d197e3 100644 --- a/src/hotspot/share/runtime/mutexLocker.hpp +++ b/src/hotspot/share/runtime/mutexLocker.hpp @@ -69,11 +69,11 @@ extern Monitor* CGC_lock; // used for coordination betwee // fore- & background GC threads. extern Monitor* STS_lock; // used for joining/leaving SuspendibleThreadSet. extern Monitor* G1OldGCCount_lock; // in support of "concurrent" full gc +extern Mutex* G1RareEvent_lock; // Synchronizes (rare) parallel GC operations. extern Mutex* G1DetachedRefinementStats_lock; // Lock protecting detached refinement stats extern Mutex* MarkStackFreeList_lock; // Protects access to the global mark stack free list. extern Mutex* MarkStackChunkList_lock; // Protects access to the global mark stack chunk list. extern Mutex* MonitoringSupport_lock; // Protects updates to the serviceability memory pools. -extern Mutex* ParGCRareEvent_lock; // Synchronizes various (rare) parallel GC ops. extern Monitor* ConcurrentGCBreakpoints_lock; // Protects concurrent GC breakpoint management extern Mutex* Compile_lock; // a lock held when Compilation is updating code (used to block CodeCache traversal, CHA updates, etc) extern Monitor* MethodCompileQueue_lock; // a lock held when method compilations are enqueued, dequeued