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

Hamlin Li mli at openjdk.java.net
Wed Apr 7 08:34:49 UTC 2021


On Tue, 6 Apr 2021 13:59:12 GMT, Thomas Schatzl <tschatzl at openjdk.org> wrote:

> 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

Marked as reviewed by mli (Reviewer).

The change looks good to me.
Thanks Thomas!

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

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



More information about the hotspot-gc-dev mailing list