RFR: 8325670: GenShen: Allow old to expand at end of each GC
Kelvin Nilsen
kdnilsen at openjdk.org
Tue Feb 13 01:04:08 UTC 2024
On Mon, 12 Feb 2024 21:20:21 GMT, Y. Srinivas Ramakrishna <ysr at openjdk.org> wrote:
>> At the end of GC, we set aside collector reserves to satisfy anticipated needs of the next GC.
>>
>> This PR reverts a change that accidentally prevents old-gen from being enlarged by this action. The observed failure condition was that mixed evacuations were not able to be performed, because old-gen was not large enough to receive the results of the desired evacuations.
>
> src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp line 1275:
>
>> 1273: // In the case that ShenandoahOldEvacRatioPercent equals 100, max_old_reserve is limited only by xfer_limit.
>> 1274: const size_t max_old_reserve = (ShenandoahOldEvacRatioPercent == 100) ?
>> 1275: old_available + xfer_limit: (young_reserve * ShenandoahOldEvacRatioPercent) / (100 - ShenandoahOldEvacRatioPercent);
>
> I guess I don't understand two things here:
>
> 1. Why do we special-case ShenandoahOldEvacRationPercent == 100 here? When it's less that 100, we consider xfer_limit only in the deficit calculations below. Should we be adding xfer_limit to the result of the above calculation irrespective of the setting of ShenandoahOldEvacRationPercent ?
> 2. Where was this adjustment being made in the code before the changes of https://github.com/openjdk/shenandoah/pull/369 ?
We special case ShenandoahOldEvacRatioPercent==100 because the "other case" has divide by (100 - ShenandoahOldEvacRatioPercent), which becomes divide by zero.
To generalize the form of the other expression, if ShenandoahOldEvacRatioPercent is 100, then there is no bound on maximum_old_evacuation_reserve. Or in other words, the bound is infinity times maximum_young_evacuation_reserve.
In the original code, before the referenced change, if we can get past the divide-by-zero issue, we would find expansion of old to be limited by the xfer_limit at line 1265:
if (old_region_deficit > max_old_region_xfer) {
old_region_deficit = max_old_region_xfer;
}
We still ultimately limit expansion by xfer_limit.
I may have misunderstood your questions. Please let me know if I missed the mark.
-------------
PR Review Comment: https://git.openjdk.org/shenandoah/pull/394#discussion_r1487009240
More information about the shenandoah-dev
mailing list