changeset 54522:60bc754b9744

8222188: Shenandoah: Adjust Shenandoah work gang types Reviewed-by: shade, rkennke
author zgu
date Fri, 12 Apr 2019 07:51:47 -0400
parents 8de62c4af8c7
children 5df03f58d25b
files src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp src/hotspot/share/gc/shenandoah/shenandoahTimingTracker.cpp src/hotspot/share/gc/shenandoah/shenandoahUtils.cpp
diffstat 3 files changed, 13 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- 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();
   }
 }
--- 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();
 }
--- 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;