RFR: 8264783: G1 BOT verification should not verify beyond allocation threshold

Thomas Schatzl tschatzl at openjdk.java.net
Wed Apr 7 08:34:48 UTC 2021


The G1 BOT contains an allocation threshold which basically acts as a "last known valid entry" index for the per-region BOT (which are views on the global BOT table).

Currently G1 BOT verification actually "verifies" the BOT within a region past that BOT index.

This causes issues with young regions; actually there is already code that prevents their BOT verification. This is perfectly fine, allocations in young regions do not update the BOTs.

With JDK-8262068/PR #2760 this existing filtering of young regions (such that their BOT is not verified) does not work because there may be young regions that are not compacted (so with a BOT that have that last known valid entry at the start of the region) are still labelled as old.

This change proposes to not try to verify the BOT beyond the last known valid index (which is arguably not worth doing), which also covers the existing young filtering.

There are alternatives that may work in particular for JDK-8262068:
a) always compact young regions (which recreates the BOT)
b) create a "dummy" BOT that spans the entire part of the region containing live objects

However they were rejected by me because
option a) takes time and directly counters that optimization for no reason
option b) makes finding the start of an object within these regions slow (they are not refined when there is at least *some* bot)

and finally I do not think there is much point in trying to be clever about areas in the BOT that are known to not contain useful values. 

Testing: tier1-3

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

Commit messages:
 - Bot fixes for 2760

Changes: https://git.openjdk.java.net/jdk/pull/3356/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=3356&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8264783
  Stats: 3 lines in 2 files changed: 1 ins; 0 del; 2 mod
  Patch: https://git.openjdk.java.net/jdk/pull/3356.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/3356/head:pull/3356

PR: https://git.openjdk.java.net/jdk/pull/3356



More information about the hotspot-gc-dev mailing list