RFR: 8351091: Shenandoah: global marking context completeness is not accurately maintained [v7]

Y. Srinivas Ramakrishna ysr at openjdk.org
Thu Apr 3 22:10:50 UTC 2025


On Fri, 7 Mar 2025 19:25:33 GMT, William Kemper <wkemper at openjdk.org> wrote:

>> 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.

I see. Yes, that makes sense to me, thanks William.

It would then be the case for the global generation that if is_mark_complete() then in the generational case that's also the case for both of its constituent generations. May be we can assert that when we fetch that at line 204 (and find it's true)?

May be I am being paranoid, but the assert would make me feel confident that the state maintenance isn't going awry.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/23886#discussion_r2027812176


More information about the hotspot-gc-dev mailing list