RFR: 8271880: Tighten condition for excluding regions from collecting cards with cross-references [v11]
Thomas Schatzl
tschatzl at openjdk.java.net
Fri Sep 17 14:16:00 UTC 2021
> Hi,
>
> can I have reviews for this change that by tightening the condition for excluding regions from collecting cards with cross-references allows us to avoid the rescanning of objects that failed evacuation in the fix up self-forwards phase after evacuation failure.
>
> I.e. during gc g1 never collects cards/references from the young gen (including eden) for later refinement - which means that we need to rescan all live objects remaining in eden regions for cross-references.
>
> The problem or the reason why we did that was that we did not want to add cards to refine from survivor regions (i.e. next gc's young gen) because we just don't need to as we always collect young gen, so references from there need not be recorded in the remembered sets (and actually, if we did, we errorneouosly marked cards in young gen which later card table verification will not like) - but we did not have that information on hand anywhere already quickly accessible.
>
> This change solves that problem by actually recording this information in the region attribute table as "NewSurvivor" type region. "NewSurvivor" because I did want to make explicit that these are the survivor regions from the *new* (next) young generation (i.e. just survivor) and not the survivor regions of the previous gc (that were turned eden at the start of this gc) but something like "NewYoung" or so would be fine with me as well (or certainly just "Survivor", but that might be confusing).
>
> Another interesting addition is probably the new assert in `G1ParThreadScanState::enqueue_card_if_tracked`
>
>
> assert(!_g1h->heap_region_containing(o)->in_collection_set(), "Should not try to enqueue reference into collection set region");
>
> This, at this time, verifies the assumption that g1 is not trying to collect references *to* the collection set, i.e. other objects that failed evacuation - after all we later relabel their regions as old *without* a remembered set; we would do otherwise unnecessarily because the reason is that (currently) cset tracking for these regions is enabled (at least during gc - we only later relabel and drop the remembered sets).
>
> This might change later if we want to move evacuation failed regions into survivor (or keep their remembered sets for some reason), but for now we filter attempts to add cards in the dcqs for those this way.
>
> Testing: tier1-5, gc/g1 with `JAVA_OPTIONS_=-XX+G1EvacuationFailureALot -XX:+VerifyAfterGC`.
>
> Thanks,
> Thomas
Thomas Schatzl has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 14 commits:
- Merge branch 'master' into pull/5037-tighten-condition
- Merge branch 'master' into evac-failure-no-scan-during-remove-self-forwards
- Fix compilation after merge
- Merge branch 'master' into evac-failure-no-scan-during-remove-self-forwards
- Add enqueue callback
- Merge branch 'master' into evac-failure-no-scan-during-remove-self-forwards
- ayang comments; note that the mentioned crash is still not fixed.
- Merge master
- Merge branch 'master' into evac-failure-no-scan-during-remove-self-forwards
- More updates to comment
- ... and 4 more: https://git.openjdk.java.net/jdk/compare/27d747ad...c708d5cb
-------------
Changes: https://git.openjdk.java.net/jdk/pull/5037/files
Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=5037&range=10
Stats: 290 lines in 23 files changed: 147 ins; 83 del; 60 mod
Patch: https://git.openjdk.java.net/jdk/pull/5037.diff
Fetch: git fetch https://git.openjdk.java.net/jdk pull/5037/head:pull/5037
PR: https://git.openjdk.java.net/jdk/pull/5037
More information about the hotspot-gc-dev
mailing list