RFR: 8331341: secondary_super_cache does not scale well: C1 and interpreter [v23]
Andrew Haley
aph at openjdk.org
Thu Oct 10 13:29:15 UTC 2024
On Thu, 10 Oct 2024 13:13:16 GMT, Andrew Haley <aph at openjdk.org> wrote:
>> src/hotspot/share/oops/klass.inline.hpp line 96:
>>
>>> 94: uintx bitmap = _secondary_supers_bitmap;
>>> 95:
>>> 96: constexpr int highest_bit_number = SECONDARY_SUPERS_TABLE_SIZE - 1;
>>
>> It looks like this needs to be the number of bits in a uintx in order to shift out the high bits, which matches the current definition of SECONDARY_SUPERS_TABLE_SIZE. But I'm wondering if we should separate the two, so that we could, for example, temporarily reduce SECONDARY_SUPERS_TABLE_SIZE to a smaller size for stress testing without the algorithm breaking. So highest_bit_number here and in the assembly code would be something like sizeof(uintx) * BitsPerByte - 1.
>
> Yes, it is the number of bits in the bitmap. Always 64 up 'til now. The fundamental nature of the algorithm is such that there is an occupancy bit for each possible slot. I could assert that here.
>
> Severe stress testing is supported by `StressSecondarySupers`, which uses a terrible hash function. I think that option tests all of the code paths.
And, a serious problem ensues if `SECONDARY_SUPERS_TABLE_SIZE` is smaller than the bits in the bitmap: we would have an error case for a bit set in the bitmap which is not in range. This would complexify the program and add a possible new source of error.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/19989#discussion_r1795428819
More information about the hotspot-dev
mailing list