changeset 59602:7de1c2fac4ca

8246612: Shenandoah: add timing tracking to ShenandoahStringDedupRoots Reviewed-by: shade
author zgu
date Thu, 04 Jun 2020 15:01:04 -0400
parents d9485795ef99
children 69c5e17adacd
files src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp src/hotspot/share/gc/shenandoah/shenandoahRootProcessor.cpp src/hotspot/share/gc/shenandoah/shenandoahRootProcessor.hpp
diffstat 3 files changed, 18 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp	Thu Jun 04 11:39:39 2020 -0700
+++ b/src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp	Thu Jun 04 15:01:04 2020 -0400
@@ -1663,7 +1663,8 @@
   ShenandoahConcurrentRootsEvacUpdateTask(ShenandoahPhaseTimings::Phase phase) :
     AbstractGangTask("Shenandoah Evacuate/Update Concurrent Strong Roots Task"),
     _vm_roots(phase),
-    _cld_roots(phase, ShenandoahHeap::heap()->workers()->active_workers()) {}
+    _cld_roots(phase, ShenandoahHeap::heap()->workers()->active_workers()),
+    _dedup_roots(phase) {}
 
   void work(uint worker_id) {
     ShenandoahConcurrentWorkerSession worker_session(worker_id);
--- a/src/hotspot/share/gc/shenandoah/shenandoahRootProcessor.cpp	Thu Jun 04 11:39:39 2020 -0700
+++ b/src/hotspot/share/gc/shenandoah/shenandoahRootProcessor.cpp	Thu Jun 04 15:01:04 2020 -0400
@@ -149,7 +149,8 @@
   }
 }
 
-ShenandoahConcurrentStringDedupRoots::ShenandoahConcurrentStringDedupRoots() {
+ShenandoahConcurrentStringDedupRoots::ShenandoahConcurrentStringDedupRoots(ShenandoahPhaseTimings::Phase phase) :
+  _phase(phase) {
   if (ShenandoahStringDedup::is_enabled()) {
     StringDedupTable_lock->lock_without_safepoint_check();
     StringDedupQueue_lock->lock_without_safepoint_check();
@@ -171,8 +172,15 @@
     assert_locked_or_safepoint_weak(StringDedupTable_lock);
 
     StringDedupUnlinkOrOopsDoClosure sd_cl(is_alive, keep_alive);
-    StringDedupQueue::unlink_or_oops_do(&sd_cl);
-    StringDedupTable::unlink_or_oops_do(&sd_cl, worker_id);
+    {
+      ShenandoahWorkerTimingsTracker x(_phase, ShenandoahPhaseTimings::StringDedupQueueRoots, worker_id);
+      StringDedupQueue::unlink_or_oops_do(&sd_cl);
+    }
+
+    {
+      ShenandoahWorkerTimingsTracker x(_phase, ShenandoahPhaseTimings::StringDedupTableRoots, worker_id);
+      StringDedupTable::unlink_or_oops_do(&sd_cl, worker_id);
+    }
   }
 }
 
@@ -360,6 +368,7 @@
    _cld_roots(ShenandoahPhaseTimings::heap_iteration_roots, 1),
    _serial_weak_roots(ShenandoahPhaseTimings::heap_iteration_roots),
    _weak_roots(ShenandoahPhaseTimings::heap_iteration_roots),
+   _dedup_roots(ShenandoahPhaseTimings::heap_iteration_roots),
    _code_roots(ShenandoahPhaseTimings::heap_iteration_roots) {
  }
 
--- a/src/hotspot/share/gc/shenandoah/shenandoahRootProcessor.hpp	Thu Jun 04 11:39:39 2020 -0700
+++ b/src/hotspot/share/gc/shenandoah/shenandoahRootProcessor.hpp	Thu Jun 04 15:01:04 2020 -0400
@@ -205,8 +205,11 @@
 };
 
 class ShenandoahConcurrentStringDedupRoots {
+private:
+  ShenandoahPhaseTimings::Phase _phase;
+
 public:
-  ShenandoahConcurrentStringDedupRoots();
+  ShenandoahConcurrentStringDedupRoots(ShenandoahPhaseTimings::Phase phase);
   ~ShenandoahConcurrentStringDedupRoots();
 
   void oops_do(BoolObjectClosure* is_alive, OopClosure* keep_alive, uint worker_id);