RFR: 8338737: Shenandoah: Reset marking bitmaps after the cycle [v2]
Xiaolong Peng
xpeng at openjdk.org
Fri Oct 18 00:08:18 UTC 2024
On Thu, 17 Oct 2024 22:39:31 GMT, Xiaolong Peng <xpeng at openjdk.org> wrote:
> > > I have some concerns about the correctness here. Consider this scenario:
> > >
> > > 1. At the end of a young _or mixed_ collection, `op_reset_after_collect` will reset young regions and unset the `needs reset` flag for the young generation.
> > > 2. An old region (A) from the mixed collection could be repurposed as a young region (it's bitmap will not be reset when it is recycled).
> > > 3. The next young/mixed collection will not reset the bitmap for region A because the `needs reset` flag is clear.
> > > 4. The collector will see stale mark bits for region A and will probably crash.
> >
> >
> > My understanding is: op_reset_after_collect is called at the end of a successful collection after the old region (A) is repurposed as a young region, if so it is not an issue, I'll double confirm.
>
> op_reset_after_collect also reset the regions are not affiliated, after a mixed/young collection, the old region should have been recycled before resetting bitmaps, so even the recycled old region is repurposed as young region later, it should be ok.
>
> If the young/mixed_ collection is set to bootstrap old GC, the reset of bitmaps is delayed to old GC to avoid dirty bitmaps
By repeatedly running test gc/stress/gcold/TestGCOldWithShenandoah.java#generational many times, I could produce a crash, not sure root cause yet, but this might be the root cause.
-------------
PR Comment: https://git.openjdk.org/shenandoah/pull/516#issuecomment-2420893946
More information about the shenandoah-dev
mailing list