RFR: 8351091: Shenandoah: global marking context completeness is not accurately maintained [v5]
William Kemper
wkemper at openjdk.org
Fri Mar 7 19:27:54 UTC 2025
On Thu, 6 Mar 2025 23:46:02 GMT, Xiaolong Peng <xpeng at openjdk.org> wrote:
>> Sorry I misunderstood your original proposal, I thought you meant to suggest to remove the flag from ShenandoahGlobalGeneration, instead the set_mark_complete/is_mark_complete will more like view/delegation layer like:
>>
>> void ShenandoahGlobalGeneration::set_mark_complete() {
>> ShenandoahGenerationalHeap* heap = ShenandoahGenerationalHeap::heap();
>> heap->young_generation()->set_mark_complete();
>> heap->old_generation()->set_mark_complete();
>> }
>>
>> bool ShenandoahGlobalGeneration::is_mark_complete() {
>> ShenandoahGenerationalHeap* heap = ShenandoahGenerationalHeap::heap();
>> return heap->young_generation()->is_mark_complete() && heap->old_generation()->is_mark_complete();
>> }
>
> You proposal will make the impl of the set_mark_complete/is_mark_complete of ShenandoahGeneration cleaner, but the thing is it will change current design and behavior, we may have to update the code where there methods is called, e.g. when we call `set_mark_complete` of gc_generation/active_generation, if it is global generation, we may have to explicitly call the same methods of ShenandoahYoungGeneration and ShenandoahOldGeneration to fan out the status.
>
> How about I follow up it in a separate task and update the implementation if necessary? I want to limit the changes involved in this PR, and only fix the bug.
The young and old generations are only instantiated in the generational mode, so using them without checking the mode will result in SEGV in non-generational modes.
Global collections have a lot of overlap with old collections. I think what Ramki is saying, is that if we change all the code that makes assertions about the completion status of young/old marking to use the `active_generation` field instead, then we wouldn't need to update the completion status of young/old during a global collection. The difficulty here is that we need assurances that the old generation mark bitmap is valid in collections subsequent to a global collection. So, I don't think we can rely on completion status of `active_generation` when it was global, in following collections where it may now refer to young or old.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/23886#discussion_r1985578948
More information about the hotspot-gc-dev
mailing list