RFR: 8351077: Shenandoah: Update comments in ShenandoahConcurrentGC::op_reset_after_collect
Y. Srinivas Ramakrishna
ysr at openjdk.org
Mon Mar 3 21:19:02 UTC 2025
On Mon, 3 Mar 2025 20:12:34 GMT, Xiaolong Peng <xpeng at openjdk.org> wrote:
> This is a trivial PR to update the code comments in ShenandoahConcurrentGC::op_reset_after_collect.
>
> After doing more test and analysis, we have a better understanding why reset bitmap of young gen after concurrent cycle may cause crash if there is pending old GC cycle to execute: When there is soft reference in old gen, but the referent is in young, reseting bitmap of young will cause wrong state of the soft reference, which may lead to expected cashes.
src/hotspot/share/gc/shenandoah/shenandoahConcurrentGC.cpp line 1235:
> 1233: // Valid bitmap of young generation is needed by concurrent weak references phase of old GC cycle,
> 1234: // because it is possible that there is soft reference in old generation with the referent in young generation;
> 1235: // therefore mark bitmap of young generation can't be reset if there will be old GC after the concurrent GC cycle.
I don't understand the comment. If the soft reference in old gen points to its referent in the young gen, then the latter should be either reachable, or should have been cleared (depending on who discovered the soft reference & the soft reference clearing policy). If the former, the old gen card should be dirty.
May be I am confused about the change in comment, but this may be pointing to a bug in the reference processing code or the associated card-marking code.
Or I am not clearly understanding your comment in context.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/23872#discussion_r1978221380
More information about the shenandoah-dev
mailing list