RFR: 8270842: G1: Only young regions need to redirty outside references in remset.

Thomas Schatzl tschatzl at openjdk.java.net
Wed Aug 4 16:10:29 UTC 2021


On Wed, 21 Jul 2021 02:13:38 GMT, Hamlin Li <mli at openjdk.org> wrote:

> For evac failure objects in non-young regions (old) of cset, the outside reference remset already recorded in the dirty queue, we only needs to do it for obj in young regions

Adding the reason why we need to re-scan only young gen objects is the use of `from->is_young()` in various places to avoid enqueuing too many cards. The exact condition would be something like `from->is_survivor()` (note: this means the newly allocated survivor regions allocated during this gc - remember that at start of the this gc we relabel all previous survivor regions as eden, which will become part of the eden of the next gc).

I (force-)pushed a prototype that adds such a label to `G1HeapRegionAttr` to also avoid touching the `HeapRegion` table completely at https://github.com/tschatzl/jdk/tree/submit/evac-failure-no-scan-during-remove-self-forwards.
During this investigation a few additional (unrelated, preexisting) issues with the current handling of objects during evacuation failure became kind of obvious, I filed https://bugs.openjdk.java.net/browse/JDK-8271871 and https://bugs.openjdk.java.net/browse/JDK-8271870.

However I think this change is good as is though and can be replaced later with a more refined version of the suggested prototype.

Testing tier1-5 has also been good afaict (still rerunning as I had some apparently different issues on Windows), as well as running gc/g1 jtreg tests with globally injected `-XX:+G1EvacuationFailureALot` (via `JAVA_OPTIONS_`).

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

Marked as reviewed by tschatzl (Reviewer).

PR: https://git.openjdk.java.net/jdk/pull/4853



More information about the hotspot-gc-dev mailing list