< prev index next >

src/hotspot/share/gc/shenandoah/shenandoahTraversalGC.cpp

Print this page
rev 50928 : Process remaining SATB buffers in final mark/traverse loop instead of separate phase
rev 50929 : [mq]: satb1.patch

@@ -241,12 +241,21 @@
     ReferenceProcessor* rp = NULL;
     if (process_refs) {
       rp = _heap->ref_processor();
     }
 
-    // Step 1: Process ordinary GC roots.
+    // Step 0: Drain outstanding SATB queues.
+    // NOTE: we piggy-back draining of remaining thread SATB buffers on the final root scan below.
     ShenandoahTraversalSATBBufferClosure satb_cl(q);
+    {
+      // Process remaining finished SATB buffers.
+      SATBMarkQueueSet& satb_mq_set = ShenandoahBarrierSet::satb_mark_queue_set();
+      while (satb_mq_set.apply_closure_to_completed_buffer(&satb_cl));
+      // Process remaining threads SATB buffers below.
+    }
+
+    // Step 1: Process ordinary GC roots.
     if (!_heap->is_degenerated_gc_in_progress()) {
       ShenandoahTraversalClosure roots_cl(q, rp);
       CLDToOopClosure cld_cl(&roots_cl);
       MarkingCodeBlobClosure code_cl(&roots_cl, CodeBlobToOopClosure::FixRelocations);
       ShenandoahTraversalSATBThreadsClosure tc(&satb_cl);
< prev index next >