8232588: G1 concurrent System.gc can return early or late

8233279: G1: GCLocker GC with +GCLockerInvokesConcurrent spins while cycle in progress

Refactor G1CH::try_collect and fix bugs with concurrent collections.

Reviewed-by: tschatzl, sjohanss
This commit is contained in:
Kim Barrett 2019-11-13 18:00:30 -05:00
parent 9ad86a68cc
commit 19bed24b1f
9 changed files with 289 additions and 213 deletions

View file

@ -72,6 +72,7 @@ Mutex* NonJavaThreadsListSync_lock = NULL;
Monitor* CGC_lock = NULL;
Monitor* STS_lock = NULL;
Monitor* FullGCCount_lock = NULL;
Monitor* G1OldGCCount_lock = NULL;
Monitor* DirtyCardQ_CBL_mon = NULL;
Mutex* Shared_DirtyCardQ_lock = NULL;
Mutex* MarkStackFreeList_lock = NULL;
@ -203,6 +204,8 @@ void mutex_init() {
def(FullGCCount_lock , PaddedMonitor, leaf, true, _safepoint_check_never); // in support of ExplicitGCInvokesConcurrent
if (UseG1GC) {
def(G1OldGCCount_lock , PaddedMonitor, leaf, true, _safepoint_check_always);
def(DirtyCardQ_CBL_mon , PaddedMonitor, access, true, _safepoint_check_never);
def(Shared_DirtyCardQ_lock , PaddedMutex , access + 1, true, _safepoint_check_never);