Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
8234020: Remove FullGCCount_lock
Reviewed-by: kbarrett
  • Loading branch information
albertnetymk committed Apr 27, 2021
1 parent 4785e11 commit 468c847
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 24 deletions.
19 changes: 0 additions & 19 deletions src/hotspot/share/gc/shared/genCollectedHeap.cpp
Expand Up @@ -254,28 +254,9 @@ size_t GenCollectedHeap::max_capacity() const {
// Update the _full_collections_completed counter
// at the end of a stop-world full GC.
unsigned int GenCollectedHeap::update_full_collections_completed() {
MonitorLocker ml(FullGCCount_lock, Mutex::_no_safepoint_check_flag);
assert(_full_collections_completed <= _total_full_collections,
"Can't complete more collections than were started");
_full_collections_completed = _total_full_collections;
ml.notify_all();
return _full_collections_completed;
}

// Update the _full_collections_completed counter, as appropriate,
// at the end of a concurrent GC cycle. Note the conditional update
// below to allow this method to be called by a concurrent collector
// without synchronizing in any manner with the VM thread (which
// may already have initiated a STW full collection "concurrently").
unsigned int GenCollectedHeap::update_full_collections_completed(unsigned int count) {
MonitorLocker ml(FullGCCount_lock, Mutex::_no_safepoint_check_flag);
assert((_full_collections_completed <= _total_full_collections) &&
(count <= _total_full_collections),
"Can't complete more collections than were started");
if (count > _full_collections_completed) {
_full_collections_completed = count;
ml.notify_all();
}
return _full_collections_completed;
}

Expand Down
2 changes: 0 additions & 2 deletions src/hotspot/share/gc/shared/genCollectedHeap.hpp
Expand Up @@ -281,8 +281,6 @@ class GenCollectedHeap : public CollectedHeap {

// Update above counter, as appropriate, at the end of a stop-world GC cycle
unsigned int update_full_collections_completed();
// Update above counter, as appropriate, at the end of a concurrent GC cycle
unsigned int update_full_collections_completed(unsigned int count);

// Update the gc statistics for each generation.
void update_gc_stats(Generation* current_generation, bool full) {
Expand Down
2 changes: 0 additions & 2 deletions src/hotspot/share/runtime/mutexLocker.cpp
Expand Up @@ -72,7 +72,6 @@ Mutex* NonJavaThreadsList_lock = NULL;
Mutex* NonJavaThreadsListSync_lock = NULL;
Monitor* CGC_lock = NULL;
Monitor* STS_lock = NULL;
Monitor* FullGCCount_lock = NULL;
Monitor* G1OldGCCount_lock = NULL;
Mutex* Shared_DirtyCardQ_lock = NULL;
Mutex* G1DetachedRefinementStats_lock = NULL;
Expand Down Expand Up @@ -212,7 +211,6 @@ void mutex_init() {
def(CGC_lock , PaddedMonitor, special, true, _safepoint_check_never); // coordinate between fore- and background GC
def(STS_lock , PaddedMonitor, leaf, true, _safepoint_check_never);

def(FullGCCount_lock , PaddedMonitor, leaf, true, _safepoint_check_never); // in support of ExplicitGCInvokesConcurrent
if (UseG1GC) {
def(G1OldGCCount_lock , PaddedMonitor, leaf, true, _safepoint_check_always);

Expand Down
1 change: 0 additions & 1 deletion src/hotspot/share/runtime/mutexLocker.hpp
Expand Up @@ -66,7 +66,6 @@ extern Mutex* NonJavaThreadsListSync_lock; // a lock for NonJavaThreads li
extern Monitor* CGC_lock; // used for coordination between
// fore- & background GC threads.
extern Monitor* STS_lock; // used for joining/leaving SuspendibleThreadSet.
extern Monitor* FullGCCount_lock; // in support of "concurrent" full gc
extern Monitor* G1OldGCCount_lock; // in support of "concurrent" full gc
extern Mutex* Shared_DirtyCardQ_lock; // Lock protecting dirty card
// queue shared by
Expand Down

1 comment on commit 468c847

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.