RFR: Recompute generation accounts after fullgc [v2]

Y. Srinivas Ramakrishna ysr at openjdk.org
Thu Mar 30 01:48:10 UTC 2023


On Thu, 30 Mar 2023 00:33:45 GMT, Kelvin Nilsen <kdnilsen at openjdk.org> wrote:

>> This fix addresses a problem found during verification following full gcs.  This recomputes the generation usage at the end of full GC as part of a 5th phase of full gc.
>> 
>> We may be able to remove this 5th phase at a later time after we find and fix whatever errors exist in generation accounting in the existing full gc implementation.
>
> Kelvin Nilsen has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Reviewer feedback: change function name to ...restore_generation_usage()

Two small nits, but can be ignored if this is "stop-gap" code for now anyway.

Reviewed!

src/hotspot/share/gc/shenandoah/shenandoahFullGC.cpp line 1506:

> 1504:         young_regions++;
> 1505:         young_usage += r->used();
> 1506:         if (r->is_humongous()) {

Two nits:

1. There is code in the two arms here that can be consolidated into a work method that can then be used to update the appropriate young or old metric.
2. It's conceptually simpler to check if is_humongous() and then add size of object if is_humongous_start. You can there also do arithmetic for the waste in the last humongous region for that object. Then you can just skip all the is_humongous_cont() regions, and save some time.

Other than that, this looks good to me.

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

Marked as reviewed by ysr (Author).

PR Review: https://git.openjdk.org/shenandoah/pull/235#pullrequestreview-1364206649
PR Review Comment: https://git.openjdk.org/shenandoah/pull/235#discussion_r1152647195


More information about the shenandoah-dev mailing list