RFR: 8262398: Shenandoah: Disable nmethod barrier and stack watermark when running with passive mode [v2]

Aleksey Shipilev shade at openjdk.java.net
Tue Mar 16 15:17:13 UTC 2021


On Tue, 16 Mar 2021 14:13:34 GMT, Zhengyu Gu <zgu at openjdk.org> wrote:

>> nmethod barrier and stack watermark allow GC not to process nmethods at GC pauses, and aim to reduce GC latency, they do not benefit STW GCs, who process nmethods at pauses anyway.
>> 
>> Test:
>> 
>> - [x] hotspot_gc_shenandoah
>> - [x] tier1 with -XX:+UseShenandoahGC
>> - [x] tier1 with -XX:+UseShenandoahGC -XX:ShenandoahGCMode=passive
>> - [x]  tier1 with -XX:+UseShenandoahGC -XX:ShenandoahGCMode=passive -XX:-ShenandoahDegeneratedGC
>
> Zhengyu Gu has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains four additional commits since the last revision:
> 
>  - Uses flags instead of mode
>  - Merge branch 'master' into JDK-8262398-disable-barriers-stw-gc
>  - JDK-8262398
>  - init

Yes, thank you. A few minor nits below.

src/hotspot/share/gc/shenandoah/mode/shenandoahPassiveMode.cpp line 46:

> 44:   if (FLAG_IS_DEFAULT(ShenandoahStackWatermarkBarrier)) {
> 45:     FLAG_SET_DEFAULT(ShenandoahStackWatermarkBarrier, false);
> 46:   }

This should just go to "// Disable known barriers by default" block below.

src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp line 405:

> 403: }
> 404: 
> 405: void ShenandoahHeap::initialize_gc_mode() {

There is `initialize_heuristics`, which means this should be `initialize_mode`?

src/hotspot/share/gc/shenandoah/shenandoahRootProcessor.inline.hpp line 179:

> 177:   CodeBlobToOopClosure update_blobs(keep_alive, CodeBlobToOopClosure::FixRelocations);
> 178:   ShenandoahCodeBlobAndDisarmClosure blobs_and_disarm_Cl(keep_alive);
> 179:   CodeBlobToOopClosure* codes_cl = ClassUnloading && ShenandoahNMethodBarrier ?

The hunk above has this in parentheses. Pick a style and stick to it, whether parentheses or not.

src/hotspot/share/gc/shenandoah/shenandoahCodeRoots.cpp line 182:

> 180: 
> 181: void ShenandoahCodeRoots::disarm_nmethods() {
> 182:   ShenandoahHeap* const heap = ShenandoahHeap::heap();

This `heap` getter can be moved into the block below, and maybe even inlined?

-------------

Marked as reviewed by shade (Reviewer).

PR: https://git.openjdk.java.net/jdk/pull/2727



More information about the hotspot-gc-dev mailing list