RFR: 8351077: Shenandoah: Update comments in ShenandoahConcurrentGC::op_reset_after_collect

Xiaolong Peng xpeng at openjdk.org
Tue Mar 4 00:12:53 UTC 2025


On Tue, 4 Mar 2025 00:02:29 GMT, Y. Srinivas Ramakrishna <ysr at openjdk.org> wrote:

>> 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.
>
> Thanks @earthling-amzn for explaining the issue to me offline. Based on my current understanding of the issue from that explanation, I'd suggest rewording the comment as follows:
> 
> // If we are in the midst of an old gc bootstrap or an old marking, we want to leave the mark bit map of
> // the young generation intact. In particular, reference processing in the old generation may potentially
> // need the reachability of a young generation referent of a Reference object in the old generation.

Thank you Ramki, I'll update the comments and refresh the PR.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/23872#discussion_r1978411180


More information about the shenandoah-dev mailing list