changeset 4759:eda078b01c65

8015268: NPG: 2.5% regression in young GC times on CRM Sales Opty Summary: Split SystemDictionary and ClassLoaderDataGraph root processing to help load balancing. Reviewed-by: tschatzl, johnc
author stefank
date Mon, 27 May 2013 15:22:59 +0200
parents 0886b99a4d1b
children 95c00927be11
files src/share/vm/gc_implementation/parallelScavenge/pcTasks.cpp src/share/vm/gc_implementation/parallelScavenge/pcTasks.hpp src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp src/share/vm/gc_implementation/parallelScavenge/psScavenge.cpp src/share/vm/gc_implementation/parallelScavenge/psTasks.cpp src/share/vm/gc_implementation/parallelScavenge/psTasks.hpp src/share/vm/memory/sharedHeap.cpp
diffstat 7 files changed, 28 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/gc_implementation/parallelScavenge/pcTasks.cpp	Fri May 24 14:16:41 2013 +0200
+++ b/src/share/vm/gc_implementation/parallelScavenge/pcTasks.cpp	Mon May 27 15:22:59 2013 +0200
@@ -120,6 +120,9 @@
 
     case system_dictionary:
       SystemDictionary::always_strong_oops_do(&mark_and_push_closure);
+      break;
+
+    case class_loader_data:
       ClassLoaderDataGraph::always_strong_oops_do(&mark_and_push_closure, &follow_klass_closure, true);
       break;
 
--- a/src/share/vm/gc_implementation/parallelScavenge/pcTasks.hpp	Fri May 24 14:16:41 2013 +0200
+++ b/src/share/vm/gc_implementation/parallelScavenge/pcTasks.hpp	Mon May 27 15:22:59 2013 +0200
@@ -98,7 +98,8 @@
     management            = 6,
     jvmti                 = 7,
     system_dictionary     = 8,
-    code_cache            = 9
+    class_loader_data     = 9,
+    code_cache            = 10
   };
  private:
   RootType _root_type;
--- a/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp	Fri May 24 14:16:41 2013 +0200
+++ b/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp	Mon May 27 15:22:59 2013 +0200
@@ -2338,6 +2338,7 @@
     q->enqueue(new MarkFromRootsTask(MarkFromRootsTask::flat_profiler));
     q->enqueue(new MarkFromRootsTask(MarkFromRootsTask::management));
     q->enqueue(new MarkFromRootsTask(MarkFromRootsTask::system_dictionary));
+    q->enqueue(new MarkFromRootsTask(MarkFromRootsTask::class_loader_data));
     q->enqueue(new MarkFromRootsTask(MarkFromRootsTask::jvmti));
     q->enqueue(new MarkFromRootsTask(MarkFromRootsTask::code_cache));
 
--- a/src/share/vm/gc_implementation/parallelScavenge/psScavenge.cpp	Fri May 24 14:16:41 2013 +0200
+++ b/src/share/vm/gc_implementation/parallelScavenge/psScavenge.cpp	Mon May 27 15:22:59 2013 +0200
@@ -408,6 +408,7 @@
       q->enqueue(new ScavengeRootsTask(ScavengeRootsTask::flat_profiler));
       q->enqueue(new ScavengeRootsTask(ScavengeRootsTask::management));
       q->enqueue(new ScavengeRootsTask(ScavengeRootsTask::system_dictionary));
+      q->enqueue(new ScavengeRootsTask(ScavengeRootsTask::class_loader_data));
       q->enqueue(new ScavengeRootsTask(ScavengeRootsTask::jvmti));
       q->enqueue(new ScavengeRootsTask(ScavengeRootsTask::code_cache));
 
--- a/src/share/vm/gc_implementation/parallelScavenge/psTasks.cpp	Fri May 24 14:16:41 2013 +0200
+++ b/src/share/vm/gc_implementation/parallelScavenge/psTasks.cpp	Mon May 27 15:22:59 2013 +0200
@@ -79,14 +79,15 @@
       break;
 
     case system_dictionary:
-      {
       SystemDictionary::oops_do(&roots_closure);
+      break;
 
-        // Move this to another root_type?
-        PSScavengeKlassClosure klass_closure(pm);
-        ClassLoaderDataGraph::oops_do(&roots_closure, &klass_closure, false);
-      }
-      break;
+    case class_loader_data:
+    {
+      PSScavengeKlassClosure klass_closure(pm);
+      ClassLoaderDataGraph::oops_do(&roots_closure, &klass_closure, false);
+    }
+    break;
 
     case management:
       Management::oops_do(&roots_closure);
--- a/src/share/vm/gc_implementation/parallelScavenge/psTasks.hpp	Fri May 24 14:16:41 2013 +0200
+++ b/src/share/vm/gc_implementation/parallelScavenge/psTasks.hpp	Mon May 27 15:22:59 2013 +0200
@@ -59,9 +59,10 @@
     object_synchronizer   = 4,
     flat_profiler         = 5,
     system_dictionary     = 6,
-    management            = 7,
-    jvmti                 = 8,
-    code_cache            = 9
+    class_loader_data     = 7,
+    management            = 8,
+    jvmti                 = 9,
+    code_cache            = 10
   };
  private:
   RootType _root_type;
--- a/src/share/vm/memory/sharedHeap.cpp	Fri May 24 14:16:41 2013 +0200
+++ b/src/share/vm/memory/sharedHeap.cpp	Mon May 27 15:22:59 2013 +0200
@@ -45,6 +45,7 @@
   SH_PS_FlatProfiler_oops_do,
   SH_PS_Management_oops_do,
   SH_PS_SystemDictionary_oops_do,
+  SH_PS_ClassLoaderDataGraph_oops_do,
   SH_PS_jvmti_oops_do,
   SH_PS_StringTable_oops_do,
   SH_PS_CodeCache_oops_do,
@@ -173,12 +174,18 @@
   if (!_process_strong_tasks->is_task_claimed(SH_PS_SystemDictionary_oops_do)) {
     if (so & SO_AllClasses) {
       SystemDictionary::oops_do(roots);
+    } else if (so & SO_SystemClasses) {
+      SystemDictionary::always_strong_oops_do(roots);
+    } else {
+      fatal("We should always have selected either SO_AllClasses or SO_SystemClasses");
+    }
+  }
+
+  if (!_process_strong_tasks->is_task_claimed(SH_PS_ClassLoaderDataGraph_oops_do)) {
+    if (so & SO_AllClasses) {
       ClassLoaderDataGraph::oops_do(roots, klass_closure, !is_scavenging);
     } else if (so & SO_SystemClasses) {
-      SystemDictionary::always_strong_oops_do(roots);
       ClassLoaderDataGraph::always_strong_oops_do(roots, klass_closure, !is_scavenging);
-    } else {
-      fatal("We should always have selected either SO_AllClasses or SO_SystemClasses");
     }
   }