RFR: 8351091: Shenandoah: global marking context completeness is not accurately maintained
Y. Srinivas Ramakrishna
ysr at openjdk.org
Wed Mar 5 18:02:57 UTC 2025
On Tue, 4 Mar 2025 23:29:18 GMT, Y. Srinivas Ramakrishna <ysr at openjdk.org> wrote:
>> With the JEP 404: Generational Shenandoah implementation, there are generation specific marking completeness flags introduced, and the global marking context completeness flag is not updated at all after initialization, hence the global marking context completeness is not accurate anymore. This may cause expected behavior: [ShenandoahHeap::complete_marking_context()](https://github.com/openjdk/jdk/pull/23886/files#diff-d5ddf298c36b1c91bf33f9bff7bedcc063074edd68c298817f1fdf39d2ed970fL642) should throw assert error if the global marking context completeness flag is false, but now it always return the marking context even it marking is not complete, this may hide bugs where we expect the global/generational marking to be completed.
>>
>> This change PR fix the bug in global marking context completeness flag, and update all the places using `ShenandoahHeap::complete_marking_context()` to use proper API.
>>
>> ### Test
>> - [x] hotspot_gc_shenandoah
>> - [x] Tier 1
>> - [x] Tier 2
>
> src/hotspot/share/gc/shenandoah/shenandoahGeneration.hpp line 206:
>
>> 204: bool is_mark_complete() { return _is_marking_complete.is_set(); }
>> 205: virtual void set_mark_complete();
>> 206: virtual void set_mark_incomplete();
>
> Why are these declared virtual?
OK, I see that `ShenandoahGlobalGeneration` forces the state of `ShenandoahOdGeneration` and `ShenandoahYoungGeneration`, but is that our intention? I am seeing (see comment elsewhere) that we are always either using global generation's marking context explicitly, or using a region to index into the appropriate containing generation's marking context. If so, can we dispense with the forcing of global context's state into the contexts for the two generations?
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/23886#discussion_r1980429065
More information about the shenandoah-dev
mailing list