[jdk20] RFR: 8298215: gc/g1/TestVerifyGCType.java failed with "Missing expected verification pattern Verifying After GC for: Pause Young (Prepare Mixed): expected true, was false"

Kim Barrett kbarrett at openjdk.org
Sun Dec 18 22:48:43 UTC 2022


Please review this fix to the calculation of the number of young regions to use.

That calculation was recently changed (JDK-8297186), but that change has a
problem.  It ensures the desired number of young regions calculated at the end
of a collection includes at least one eden region, to ensure progress is made.
It accomplished this by ensuring the minimum length was the number of already
allocated regions + 1 when doing the calculation at the end of a GC.  But for
a revision of the length during the mutator phase it intentionally didn't do
that, as we want to trigger a collection rather than forceably expand.

However, a revision may occur immediately after the GC (indeed that's fairly
likely after JDK-8137022).

A better calculation is to ensure the desired number of young regions is at
least the number of survivor regions + 1.  (That's effectively what the old
code was doing in the end-of-GC calculation, since at that time all allocated
regions are survivor regions.)  So that's the basic change.  This also removes
the need to distinguish between updating for GC or during the mutator phase
that was introduced by JDK-8297186 (the "after-gc" argument).

Also changed the test to also include the subprocess log in the error message
when the check for verification messages fails, to aid any future debugging.

Testing:

mach5 tier1-3.  This isn't all that revealing, since the test failure was very
intermittent.

Hand tested with my changes to address JDK-8293824.  With just those changes
the test was failing pretty reliably (instead of intermittently).  Adding the
changes proposed here lets that test (seemingly) reliably pass.  (There might
still be some work to do for JDK-8293824.)

There are some naming and description comment improvements around
update_young_length_bounds that I'd like to make, but I'm deferring those as a
separate RFE and keeping this bug fix fairly minimal.

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

Commit messages:
 - remove TestVerifyGCType from problem list
 - always include one eden in desired young length
 - print data for verification pattern failure

Changes: https://git.openjdk.org/jdk20/pull/52/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk20&pr=52&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8298215
  Stats: 49 lines in 4 files changed: 4 ins; 26 del; 19 mod
  Patch: https://git.openjdk.org/jdk20/pull/52.diff
  Fetch: git fetch https://git.openjdk.org/jdk20 pull/52/head:pull/52

PR: https://git.openjdk.org/jdk20/pull/52


More information about the hotspot-gc-dev mailing list