RFR: JDK-8226757: Shenandoah: Make Traversal a separate mode

Aleksey Shipilev shade at redhat.com
Tue Jun 25 19:44:51 UTC 2019

On 6/25/19 8:09 PM, Roman Kennke wrote:
>  Currently, Traversal GC is activated by selecting the 'traversal'
> heuristic. However, Traversal GC is not exactly a heuristic. It is a
> whole different mode, that is structurally different from the normal
> Shenandoah GC operation. In addition to that, it would be useful to have
> several Traveral GC heuristics, aggressive for testing, compact for low
> memory footprint, passive to drive Traversal without barriers, etc. The
> current traversal heuristic would become the Traversal mode's 'adaptive'
> heuristic.
> I propose to add a new option -XX:ShenandoahGCMode=normal|traversal that
> selects the mode of operation, and then Traversal GC can also pick up
> different heuristics via the usual -XX:ShenandoahGCHeuristics option.
> The change drops Traversal-specific parts from ShenandoahHeuristics, and
> re-wires them in more useful ways. A big part of the change is adjusting
> tests for changed options.
> http://cr.openjdk.java.net/~rkennke/JDK-8226757/webrev.00/

Brief look:

*) I wonder if it makes sense to rework it more thoroughly:
 modes:      {passive, normal, traversal}
 heuristics: {aggressive, compact, adaptive, static}

 ...so that modes select barriers, and heuristics only selects when to start the cycle.

*) should_start_normal_gc() is now simply should_start_gc()?

*) I guess this can be done in "default_cause", near "default_mode":

 156         cause = mode == concurrent_traversal ? GCCause::_shenandoah_traversal_gc :

*) Looks to me, there would be no message printed if we supply wrong mode?

*) I don't think it is fair to call it scavenge. Description also implies "normal" is not
concurrent? I'd say "normal (mark, then evac, then update)" and "traversal (mark+evac+update)".

  75   experimental(ccstr, ShenandoahGCMode, "normal",                           \
  76           "The GC mode to use in Shenandoah GC. Possible values"            \
  77           " *) normal    - normal GC (mark-evac-update)"                    \
  78           " *) traversal - Traversal GC (concurent scavange)")              \

*) TestWrongBarrierDisable.java: indenting, L58:

  54         shouldFailAll("-XX:ShenandoahGCHeuristics=adaptive",   concurrent);
  55         shouldFailAll("-XX:ShenandoahGCHeuristics=static",     concurrent);
  56         shouldFailAll("-XX:ShenandoahGCHeuristics=compact",    concurrent);
  57         shouldFailAll("-XX:ShenandoahGCHeuristics=aggressive", concurrent);
  58         shouldFailAll("-XX:ShenandoahGCMode=traversal",  traversal);
  59         shouldPassAll("-XX:ShenandoahGCHeuristics=passive",    concurrent);
  60         shouldPassAll("-XX:ShenandoahGCHeuristics=passive",    traversal);


More information about the hotspot-gc-dev mailing list