RFR: 8271880: Tighten condition for excluding regions from collecting cards with cross-references [v15]

Thomas Schatzl tschatzl at openjdk.java.net
Thu Sep 23 10:40:43 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 incrementally with two additional commits since the last revision:

 - Update src/hotspot/share/gc/g1/g1ParScanThreadState.cpp
 - Update src/hotspot/share/gc/g1/g1ParScanThreadState.cpp
   
   Co-authored-by: Stefan Johansson <54407259+kstefanj at users.noreply.github.com>

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

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/5037/files
  - new: https://git.openjdk.java.net/jdk/pull/5037/files/d000beed..6393624c

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=5037&range=14
 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=5037&range=13-14

  Stats: 2 lines in 1 file changed: 0 ins; 0 del; 2 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