RFR: Adjust worker threads according to refproc-ergo decisions

Roman Kennke rkennke at redhat.com
Mon Jun 25 12:29:24 UTC 2018


Am 25.06.2018 um 14:17 schrieb Aleksey Shipilev:
> On 06/25/2018 02:08 PM, Roman Kennke wrote:
>> Last upstream merge brought some ReferenceProcessor goodness, in which
>> the RP would tell the task executors how many worker threads it
>> considers useful. This change makes the reference task executors use as
>> many threads as it's told.
> 
> I think since you are changing the number of workers in the middle of GC op, e.g. inside the
> final-mark that has its own number of worker threads, you need to use ShenandoahPushWorkerScope, to
> restore the number once you leave refproc stage.

Right, good point.

> Have you tried it with e.g. Serial?
>   http://mail.openjdk.java.net/pipermail/shenandoah-dev/2018-June/006175.html

It looks good, I think (with Serial):

https://paste.fedoraproject.org/paste/4EREESzIj~Ng8VIXWeSGKA

Updated changeset:

# HG changeset patch
# User rkennke
# Date 1529929668 -7200
#      Mon Jun 25 14:27:48 2018 +0200
# Node ID a06f3b6d1305c952aba126bc553ad203c2ea9d1d
# Parent  1f5c9cf67f8f00e41056b406de986be3115f0f99
Adjust worker threads according to refproc-ergo decisions

diff --git
a/src/hotspot/share/gc/shenandoah/shenandoahConcurrentMark.cpp
b/src/hotspot/share/gc/shenandoah/shenandoahConcurrentMark.cpp
--- a/src/hotspot/share/gc/shenandoah/shenandoahConcurrentMark.cpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahConcurrentMark.cpp
@@ -664,6 +664,9 @@

     ShenandoahHeap* heap = ShenandoahHeap::heap();
     ShenandoahConcurrentMark* cm = heap->concurrentMark();
+    ShenandoahPushWorkerScope scope(_workers,
+                                    ergo_workers,
+                                    "reference processing");
     uint nworkers = _workers->active_workers();
     cm->task_queues()->reserve(nworkers);
     if (UseShenandoahOWST) {
diff --git a/src/hotspot/share/gc/shenandoah/shenandoahTraversalGC.cpp
b/src/hotspot/share/gc/shenandoah/shenandoahTraversalGC.cpp
--- a/src/hotspot/share/gc/shenandoah/shenandoahTraversalGC.cpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahTraversalGC.cpp
@@ -1068,6 +1068,9 @@

     ShenandoahHeap* heap = ShenandoahHeap::heap();
     ShenandoahTraversalGC* traversal_gc = heap->traversal_gc();
+    ShenandoahPushWorkerScope scope(_workers,
+                                    ergo_workers,
+                                    "reference processing");
     uint nworkers = _workers->active_workers();
     traversal_gc->task_queues()->reserve(nworkers);
     if (UseShenandoahOWST) {



More information about the shenandoah-dev mailing list