RFR: 8306920: G1: Calculate garbage bytes for evacuation failed regions from marked live bytes

Thomas Schatzl tschatzl at openjdk.org
Fri May 26 09:50:03 UTC 2023


On Wed, 24 May 2023 09:38:23 GMT, Thomas Schatzl <tschatzl at openjdk.org> wrote:

> Hi all,
> 
>   please review this refactoring that uses `G1ConcurrentMark`'s live bytes/marking to collect the amount of live bytes for evacuation failed regions instead of calculating it piecemeal while removing self-forwards.
> 
> The reason is that the functionality to keep evacuation failed regions in the remembered sets to clear them out quickly ([JDK-8140326](https://bugs.openjdk.org/browse/JDK-8140326)) needs the region's live bytes to determine whether the region is retained (i.e. put into the collection set candidates).
> 
> The live bytes for a region will be required in G1's post evacuation phase 1, but currently is calculated in post evacuation phase 2. I.e. this change avoids splitting up post evacuation phase 2 and shuffling around phases (it also makes assignment of live bytes to evacuation failed regions non-incremental, which makes it imo easier to understand).
> 
> The change does add, if there is an evacuation failure, a very short serial phase that calculates the final liveness bytes for a region (that is O(#worker threads)).
> The reason for reusing `ConcurrentMark`'s liveness gathering infrastructure is because it's already there and there is no (problematic) overlap with its use during marking; i.e. marking only uses live byte array entries for regions that are marked through, and evacuation failure can only happen for regions in the (candidate) collection set, which g1 never marks through.
> 
> Testing: tier1-5
> 
> Thanks,
>   Thomas

The result of an internal discussion has been to do a more limited version of [JDK-8140326](https://bugs.openjdk.org/browse/JDK-8140326)) that does not need these changes. So I'm retracting this PR, and will follow up with [JDK-8140326](https://bugs.openjdk.org/browse/JDK-8140326)) directly.
If there is need, we'll revisit this again.

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

PR Comment: https://git.openjdk.org/jdk/pull/14118#issuecomment-1564119704


More information about the hotspot-gc-dev mailing list