RFR: 8352588: GenShen: Enabling JFR asserts when getting GCId [v4]
William Kemper
wkemper at openjdk.org
Tue Mar 25 23:23:13 UTC 2025
On Mon, 24 Mar 2025 23:08:18 GMT, Y. Srinivas Ramakrishna <ysr at openjdk.org> wrote:
>> 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.
>
> @earthling-amzn : Is your concern that GC count is incremented concurrently by two different callers? If so, I'd have the atomic increment return the pre- or post-increment value as the case may be and have the caller use that in their mark label. (Question: do we have different Id's for young and a concurrent/interrupted old? -- I would imagine so, with the old carrying an older id, and each subsequent young getting a newer id).
My concern was more that `ShenandoahController::_gc_id` hides a field in its base class `NamedThread::_gc_id`, but `ShenandoahController::_gc_id` starts from `1`, while `NamedThread::_gc_id` starts from `0`. I think this will be addressed in a separate PR. This PR has been simplified to only fix the root cause of the assertion failure.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/24166#discussion_r2013061689
More information about the shenandoah-dev
mailing list