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

Thomas Schatzl tschatzl at openjdk.java.net
Mon Aug 2 16:15:34 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

The problem of patch H is that in `G1ScanEvacuatedObjClosure::do_oop_work` the code does not always enqueue cards but only if the reference is already outside of the collection set.
If inside the collection set, we push it on the task queue, meaning that ultimately we call `G1ParScanThreadState::do_oop_evac` on it; the suggested patch A then unconditionally enqueues the card that we "missed" just before.

I experimented a bit how to remove the iteration during self-forwarding pointer removal, one option (not 100% finished, one FIXME and some commented out asserts and the new class isn't as nice as it could be, but it seems to work) is here: https://github.com/tschatzl/jdk/tree/submit/evac-failure-no-scan-during-remove-self-forwards

Not sure if I like it, and we would need to test if it actually an improvement (i.e. faster overall - important for region based pinning). So for now the original patch from you seems best to continue with. Initial look at it seems good, but let me push it through our internal testing and re-review it.

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

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



More information about the hotspot-gc-dev mailing list