# HG changeset patch # User zgu # Date 1555069907 14400 # Node ID 60bc754b9744110f87c165b7930ebcf2b2be4eba # Parent 8de62c4af8c7632da597992e4a6ec3da03737735 8222188: Shenandoah: Adjust Shenandoah work gang types Reviewed-by: shade, rkennke diff -r 8de62c4af8c7 -r 60bc754b9744 src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp --- a/src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp Fri Apr 12 13:35:23 2019 +0800 +++ b/src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp Fri Apr 12 07:51:47 2019 -0400 @@ -459,8 +459,8 @@ _max_workers = MAX2(_max_workers, 1U); _workers = new ShenandoahWorkGang("Shenandoah GC Threads", _max_workers, - /* are_GC_task_threads */true, - /* are_ConcurrentGC_threads */false); + /* are_GC_task_threads */ true, + /* are_ConcurrentGC_threads */ true); if (_workers == NULL) { vm_exit_during_initialization("Failed necessary allocation."); } else { @@ -470,7 +470,8 @@ if (ShenandoahParallelSafepointThreads > 1) { _safepoint_workers = new ShenandoahWorkGang("Safepoint Cleanup Thread", ShenandoahParallelSafepointThreads, - false, false); + /* are_GC_task_threads */ false, + /* are_ConcurrentGC_threads */ false); _safepoint_workers->initialize_workers(); } } diff -r 8de62c4af8c7 -r 60bc754b9744 src/hotspot/share/gc/shenandoah/shenandoahTimingTracker.cpp --- a/src/hotspot/share/gc/shenandoah/shenandoahTimingTracker.cpp Fri Apr 12 13:35:23 2019 +0800 +++ b/src/hotspot/share/gc/shenandoah/shenandoahTimingTracker.cpp Fri Apr 12 07:51:47 2019 -0400 @@ -76,8 +76,11 @@ phase == ShenandoahPhaseTimings::full_gc_weakrefs_termination, "Only these phases"); - assert(Thread::current()->is_VM_thread() || Thread::current()->is_ConcurrentGC_thread(), - "Called from wrong thread"); + assert(!Thread::current()->is_Worker_thread() && + (Thread::current()->is_VM_thread() || + Thread::current()->is_ConcurrentGC_thread()), + "Called from wrong thread"); + _current_termination_phase = phase; ShenandoahHeap::heap()->phase_timings()->termination_times()->reset(); } diff -r 8de62c4af8c7 -r 60bc754b9744 src/hotspot/share/gc/shenandoah/shenandoahUtils.cpp --- a/src/hotspot/share/gc/shenandoah/shenandoahUtils.cpp Fri Apr 12 13:35:23 2019 +0800 +++ b/src/hotspot/share/gc/shenandoah/shenandoahUtils.cpp Fri Apr 12 07:51:47 2019 -0400 @@ -100,9 +100,10 @@ ShenandoahGCPhase::ShenandoahGCPhase(const ShenandoahPhaseTimings::Phase phase) : _heap(ShenandoahHeap::heap()), _phase(phase) { - assert(Thread::current()->is_VM_thread() || - Thread::current()->is_ConcurrentGC_thread(), - "Must be set by these threads"); + assert(!Thread::current()->is_Worker_thread() && + (Thread::current()->is_VM_thread() || + Thread::current()->is_ConcurrentGC_thread()), + "Must be set by these threads"); _parent_phase = _current_phase; _current_phase = phase;