RFR: 8318019: GenShen: Fix assertion to allow empty evacuation cycles

Zhengyu Gu zgu at openjdk.org
Thu Oct 12 14:35:41 UTC 2023


On Wed, 11 Oct 2023 22:35:13 GMT, Kelvin Nilsen <kdnilsen at openjdk.org> wrote:

>> src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp line 2429:
>> 
>>> 2427:   bool updating_or_evacuating = _gc_state.is_set(UPDATEREFS | EVACUATION);
>>> 2428:   bool evacuating = _gc_state.is_set(EVACUATION);
>>> 2429:   assert ((has_forwarded == updating_or_evacuating) || (evacuating && !has_forwarded && collection_set()->is_empty()),
>> 
>> Sorry, I did not realize this is generational Shenandoah. I am a bit puzzled why setting `EVACUATION` flag if collection set is empty?
>
> It's a trick we use for a form of "abbreviated" cycle.  Sometimes, we have nothing to evacuate, but we have a bunch of regions that reside in young, which are old enough to be promoted.  If they are populated with a sufficient amount of live data, we promote them "in place" by simply relabeling the affiliation of the region rather than evacuating it.  But there's a non-trivial amount of processing required on the content of the region when it becomes old, so that the region can now maintain a remembered set of pointers from old to young.  We normally do this processing as part of the evacuation cycle.  In very rare scenarios, we'll end up with an evacuation cycle that only deals with promote-in-place regions, and nothing else...  That's the special scenario we're talking about here.

Thanks for the explanation!

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

PR Review Comment: https://git.openjdk.org/shenandoah/pull/337#discussion_r1355866169


More information about the shenandoah-dev mailing list