6990359: G1: don't push a stolen entry on the taskqueue, deal with it directly
authortonyp
Thu, 14 Oct 2010 10:38:14 -0400
changeset 6980 d19831e79825
parent 6959 01bebea2fd5c
child 6981 ecfe524b1fa7
6990359: G1: don't push a stolen entry on the taskqueue, deal with it directly Summary: When an entry is stolen, don't push it on the task queue but process it directly. Reviewed-by: iveresov, ysr, jcoomes
hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp
hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp
--- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp	Tue Oct 12 11:29:45 2010 -0700
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp	Thu Oct 14 10:38:14 2010 -0400
@@ -4118,10 +4118,14 @@
     while (queues()->steal(pss->queue_num(), pss->hash_seed(), stolen_task)) {
       assert(pss->verify_task(stolen_task), "sanity");
       if (stolen_task.is_narrow()) {
-        pss->push_on_queue((narrowOop*) stolen_task);
+        pss->deal_with_reference((narrowOop*) stolen_task);
       } else {
-        pss->push_on_queue((oop*) stolen_task);
+        pss->deal_with_reference((oop*) stolen_task);
       }
+
+      // We've just processed a reference and we might have made
+      // available new entries on the queues. So we have to make sure
+      // we drain the queues as necessary.
       pss->trim_queue();
     }
   } while (!offer_termination());
--- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp	Tue Oct 12 11:29:45 2010 -0700
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp	Thu Oct 14 10:38:14 2010 -0400
@@ -1772,7 +1772,6 @@
     }
   }
 
-private:
   template <class T> void deal_with_reference(T* ref_to_scan) {
     if (has_partial_array_mask(ref_to_scan)) {
       _partial_scan_cl->do_oop_nv(ref_to_scan);