RFR: 8338737: Shenandoah: Reset marking bitmaps after the cycle
William Kemper
wkemper at openjdk.org
Sat Dec 21 00:30:35 UTC 2024
On Fri, 20 Dec 2024 23:51:58 GMT, Xiaolong Peng <xpeng at openjdk.org> wrote:
>> src/hotspot/share/gc/shenandoah/shenandoahConcurrentGC.cpp line 1211:
>>
>>> 1209: // Only reset for young generation, bitmap for old generation must be retained,
>>> 1210: // except there is collection(global/old/degen/full) trigged to collect regions in old gen.
>>> 1211: heap->young_generation()->reset_mark_bitmap<false>();
>>
>> Shouldn't it be safe to reset young region bitmaps even when old marking is in progress?
>
> Not really, if old marking is in progress, but current cycle is not bootstrap cycle, it means previous old collection has been cancelled to deal with allocation failure, control thread will try to resume old collection agin which will resume old marking again.
The old cycle may be preempted by young collections, but it is only really _cancelled_ by global cycles or full GCs. Control thread will resume old marking, but this operates independently from young bitmap regions. I think we can reset young region bitmaps even when concurrent old marking is on going.
>> src/hotspot/share/gc/shenandoah/shenandoahGeneration.cpp line 58:
>>
>>> 56: if (PREPARE_FOR_CURRENT_CYCLE) {
>>> 57: if (region->need_bitmap_reset() && _heap->is_bitmap_slice_committed(region)) {
>>> 58: _ctx->clear_bitmap(region);
>>
>> Should this also `region->unset_need_bitmap_reset()`?
>
> It is for current cycle, bitmaps will be dirty anyway, for next cycle reset will be needed, so the flag can't be unset here
Got it.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/22778#discussion_r1894516552
PR Review Comment: https://git.openjdk.org/jdk/pull/22778#discussion_r1894516866
More information about the shenandoah-dev
mailing list