RFR: 8352588: GenShen: Enabling JFR asserts when getting GCId [v4]

Xiaolong Peng xpeng at openjdk.org
Mon Mar 24 18:48:15 UTC 2025


On Mon, 24 Mar 2025 18:30:23 GMT, William Kemper <wkemper at openjdk.org> wrote:

>> Xiaolong Peng has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   No need to calculate gc_id using gc_count
>
> src/hotspot/share/gc/shenandoah/shenandoahControlThread.cpp line 137:
> 
>> 135:       // GC is starting, bump the internal gc count and set GCIdMark
>> 136:       update_gc_count();
>> 137:       GCIdMark gc_id_mark;
> 
> Can we still set the `GCIdMark` with our internal counter? I'd prefer they stay in sync explicitly.

GCIdMark use [GCId::_next_id](https://github.com/openjdk/jdk/blob/master/src/hotspot/share/gc/shared/gcId.cpp#L31) here to generate GC id, if we do that the GCId::_next_id will remain 0, which is a the behavior change I had concern about. 

We can do it in another approach to keep both counters in sync explicitly:

GCIdMark gc_id_mark;
update_gc_count(gc_id() + 1)


What do you think?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/24166#discussion_r2010743091


More information about the shenandoah-dev mailing list