RFR: 8333750: GenShen: Only instantiate young/old generations in generational mode [v3]

William Kemper wkemper at openjdk.org
Tue Jun 11 18:48:28 UTC 2024


On Tue, 11 Jun 2024 03:03:51 GMT, Y. Srinivas Ramakrishna <ysr at openjdk.org> wrote:

>> William Kemper has updated the pull request incrementally with three additional commits since the last revision:
>> 
>>  - Make age and youth const
>>  - Do not age regions after completing old mark
>>  - Detect cancellation of old GC after final mark.
>
> src/hotspot/share/gc/shenandoah/shenandoahHeapRegion.cpp line 140:
> 
>> 138:        if (heap->mode()->is_generational()) {
>> 139:          heap->young_generation()->increment_affiliated_region_count();
>> 140:        }
> 
> I assume the strict order here is on account of assertion checks in some of these methods? Otherwise, one might simplify it by moving the affiliation setting out from the sandwich of the count adjustments which are conditional on generational mode.
> 
> Ideally the count for young gen in non-generational mode would work for the generational case, and we could just adjust the old count like now and drop the adjustment of young count (lines 138-140) entirely, because they are covered by line 137.

We should be able to remove one of the mode checks. We don't maintain affiliated region counts in non-generational modes. There is a `TODO` for this: https://github.com/openjdk/shenandoah/blob/master/src/hotspot/share/gc/shenandoah/shenandoahGeneration.cpp#L872

I think this PR makes it easier to tackle that `TODO`, but it will be a separate PR.

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

PR Review Comment: https://git.openjdk.org/shenandoah/pull/444#discussion_r1635336191


More information about the shenandoah-dev mailing list