RFR: 8314157: G1: TARSes not cleared after JDK-8140326, making yielding during scrubbing inoperable

Thomas Schatzl tschatzl at openjdk.org
Mon Aug 21 09:11:45 UTC 2023


Hi all,

  can I have reviews for this change that fixes a bug with old regions that were evacuated being unnecessarily scanned through during the rebuild remsets phase.

The existing rebuild remsets code uses TARS to indicate whether and what part of a region needs to be scanned. After evacuating an old region during that phase, TARS needs to be reset for these regions, otherwise the code may continue to scan them, which can cause crashes (I could not reproduce any crashes).

(I remember having had this code in early versions of the JDK-8140326 change, but I do not remember why I removed it)

The original bug, about initialization of the `yielded` variable is secondary: this is an optimization to not re-check TARSes again if there has been no yielding (safepoint) while processing.

Two items to consider:
* maybe it is useful to remove the `yielded` variable because it is unnecessary as the re-echeck for TARS isn't that expensive anyway.
* the new `G1ConcurrentMark::old_region_reclaimed` method uses `clear_statistics()` which does more than necessary - this is mainly done to be in sync with the `humongous_object_eagerly_reclaimed` method. I was wondering whether it may be useful to handle the eager reclaim candidates similarly to retained regions (now that it is possible with JDK-8140326), i.e. _not_ mark through them at all, making the `clear_statistics` and quite some other code related to eager reclaim obsolete.

Testing: tier1-3

Thanks,
  Thomas

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

Commit messages:
 - Improve code, add documentation
 - initial version

Changes: https://git.openjdk.org/jdk/pull/15359/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=15359&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8314157
  Stats: 24 lines in 4 files changed: 21 ins; 0 del; 3 mod
  Patch: https://git.openjdk.org/jdk/pull/15359.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/15359/head:pull/15359

PR: https://git.openjdk.org/jdk/pull/15359


More information about the hotspot-gc-dev mailing list