RFR: Adjust worker threads according to refproc-ergo decisions

Aleksey Shipilev shade at redhat.com
Mon Jun 25 12:17:34 UTC 2018


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.

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

-Aleksey

> Testing: tier3_gc_shenandoah
> 
> 
> # HG changeset patch
> # User rkennke
> # Date 1529928409 -7200
> #      Mon Jun 25 14:06:49 2018 +0200
> # Node ID 93432b06f44cf0ecc66a6691e600f9de6cc2e86a
> # 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();
> +    ShenandoahWorkerScope 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();
> +    ShenandoahWorkerScope 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