RFR: 8314972: GenShen: promote_in_place needs to prepare remembered set before it enables old allocations within region

Kelvin Nilsen kdnilsen at openjdk.org
Fri Aug 25 17:30:47 UTC 2023


On Fri, 25 Aug 2023 17:11:35 GMT, Y. Srinivas Ramakrishna <ysr at openjdk.org> wrote:

>> src/hotspot/share/gc/shenandoah/shenandoahHeapRegion.cpp line 1020:
>> 
>>> 1018:   assert(get_top_before_promote() == tams, "Cannot promote regions in place if top has advanced beyond TAMS");
>>> 1019: 
>>> 1020:   // Since this region may have served previously as OLD, it may hold obsolete object range info.
>> 
>> Why don't we clear the range when an old region is freed, rather than waiting for it to become old? Then we could assert here that the range is clear. Young regions wouldn't register objects so nothing would need to be done for young regions.
>
> May be modify the comment to state something like:
> // Clear any obsolete object start information; we'll register the live objects in the loop below,
> // as well as registering and stamping free block fillers over dead objects.
> // We also dirty the card table for the entire allocated range; it'll be updated/refined when we
> // scan it next time for young pointers.

We don't clear object registrations when an old region is freed because often times, the free region may next be put into service as a young-region, where the object registrations are "don't care" values.  I'll make the adjustment to the comment.

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

PR Review Comment: https://git.openjdk.org/shenandoah/pull/310#discussion_r1305947540


More information about the shenandoah-dev mailing list