RFR: JDK-8305334: GenShen: reference processing needs a card-marking barrier [v2]

Y. Srinivas Ramakrishna ysr at openjdk.org
Fri Mar 31 20:55:53 UTC 2023


> Global collections can create new cross-generational pointers during j.l.r.Reference processing which should be added to the card marking remembered set. The issue was found with dacapo during heap verification and happens somewhat rarely. I added the requisite barrier and provided a comment describing the sole situation in reference processing that should need the barrier. Assertions check this condition, but the card is also redundantly dirtied for young collections too where it's strictly not needed.
> 
> I have tested with and without heap verification using product and fastdebug builds using dacapo and specjbb, and through our internal tests pipelines.
> 
> I have not run any specific performance comparisons to assess the impact of the checks for applications that traffic heavily in j.l.r.Refs, but I do not expect much impact.

Y. Srinivas Ramakrishna has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains four additional commits since the last revision:

 - Merge branch 'master' into ref_proc_card_mark_fix
 - Add documentation comment & some assertions.
 - When (generational) GC discovers j.l.Reference:s in both generations, then subsequent
   processing of the discovered list may create new old to young pointers
   which the young collector needs to know about. This fix takes care of
   marking cards for that case.
   
   The issue was revealed during a verification failure and subsequently
   verified by means of a check in the reference processing code to detect
   the condition when the new cross generational pointer was being created
   without the associated card-marking. This typically happens when
   discovery is in both generations -- for young collections such Reference
   objects in the old generation are discovered during the card scanning,
   and for global collections when objects are marked. The situation is
   typically rare in the case of young collections because the Reference
   objects typically lie on dirty cards and hold pointers to referents in
   the young generation.
 - Shelve for now. May not compile.

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

Changes:
  - all: https://git.openjdk.org/shenandoah/pull/238/files
  - new: https://git.openjdk.org/shenandoah/pull/238/files/cca3d009..4e6fb943

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=shenandoah&pr=238&range=01
 - incr: https://webrevs.openjdk.org/?repo=shenandoah&pr=238&range=00-01

  Stats: 13435 lines in 586 files changed: 7831 ins; 2905 del; 2699 mod
  Patch: https://git.openjdk.org/shenandoah/pull/238.diff
  Fetch: git fetch https://git.openjdk.org/shenandoah.git pull/238/head:pull/238

PR: https://git.openjdk.org/shenandoah/pull/238


More information about the shenandoah-dev mailing list