RFR: 8322484: 22-b26 Regression in J2dBench-bimg_misc-G1 (and more) on Windows-x64 and macOS-x64 [v2]
Thomas Schatzl
tschatzl at openjdk.org
Fri Jan 26 09:29:53 UTC 2024
On Thu, 25 Jan 2024 16:23:27 GMT, Thomas Schatzl <tschatzl at openjdk.org> wrote:
>> I think you are correct if you change the default value of the region idx to `HRM_REGION_IDX`. Let me try this.
>
> 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.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/17552#discussion_r1467403593
More information about the hotspot-gc-dev
mailing list