RFR: 8322484: 22-b26 Regression in J2dBench-bimg_misc-G1 (and more) on Windows-x64 and macOS-x64 [v4]
Thomas Schatzl
tschatzl at openjdk.org
Mon Jan 29 08:52:36 UTC 2024
On Fri, 26 Jan 2024 09:22:57 GMT, Thomas Schatzl <tschatzl at openjdk.org> wrote:
>> It's `G1_NO_HRM_INDEX`....
>
>> I think _count should never underflow here. Consider adding an assertion.
>
> That is not true. Consider this case:
>
>
> pin(0); // _region_idx = 0; _count = 1
> execute gc; // _region_idx = -1; _count = 0
> pin(0); // _region_idx = 0; _count = 1
> unpin(0); // _region_idx = 0; _count = 0
> unpin(0); // _region_idx = 0; _count = -1
>
> When flushing the counts during gc there can also be temporary underflow.
>
> However after merging (before gc) the count should be >= 0; we could, for verification/get/release inconsistency checking reserve a range (e.g. 4k) out of the 64 bit `size_t` range (e.g. from -4095 to -1) to mean that the program does too many releases; however `gc+heap+region=trace` logging also shows pincounts at every gc for every region, so this would only automate existing available logging. Also I would prefer doing that separate from this performance fix.
Filed https://bugs.openjdk.org/browse/JDK-8324823.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/17552#discussion_r1469253090
More information about the hotspot-gc-dev
mailing list