RFR: 8369013: Shenandoah: passive mode should support enabling ShenandoahCardBarrier
William Kemper
wkemper at openjdk.org
Tue Oct 28 21:35:04 UTC 2025
On Fri, 24 Oct 2025 00:18:03 GMT, Rui Li <duke at openjdk.org> wrote:
> Add card barriers to passive mode to test out the price of card barriers.
>
> How this change is implemented is to instantiate the old region in passive mode - old region owns the card table so this would minimize the code change with a bit price of native memory. It does sound weird to have old gen in passive mode, but since passive mode is a just diagnostic mode, we'll go with it for the cleanliness of the change.
Looks good. I think we should clear the card table for each degenerated cycle. Thank you for adding the test!
src/hotspot/share/gc/shenandoah/shenandoahFullGC.cpp line 1177:
> 1175:
> 1176: // passive mode with ShenandoahCardBarrier turned on, clean the write table without swapping the tables
> 1177: if (ShenandoahCardBarrier && !heap->mode()->is_generational()) {
In general, the passive mode will only initiate a _degenerated_ cycle. It will run a full GC only if the degenerated cycle cannot evacuate or it doesn't make "good progress". Could we move this behavior into `shDegeneratedGC` or somewhere in `shPassiveHeuristic`? Cleaning the card table on every GC would be more aligned with the concurrent mode behavior.
-------------
PR Review: https://git.openjdk.org/jdk/pull/27966#pullrequestreview-3390877820
PR Review Comment: https://git.openjdk.org/jdk/pull/27966#discussion_r2471100098
More information about the hotspot-gc-dev
mailing list