RFR: 8332587: RISC-V: secondary_super_cache does not scale well [v8]
Andrew Haley
aph at openjdk.org
Wed Jun 19 10:49:18 UTC 2024
On Wed, 19 Jun 2024 08:19:38 GMT, Andrew Haley <aph at openjdk.org> wrote:
>>> Disabling `UseSecondarySupersTable` is probably not a good idea.
>>>
>>> https://github.com/openjdk/jdk/blob/48621ae193ef70b2fae4dcb7ddc524f349beb131/src/hotspot/cpu/x86/macroAssembler_x86.cpp#L4743
>>>
>>> is a better and easier way to handle this situation.
>>
>> Hi, The same question has been raised before. Here is the implementation and test data using scalar registers. https://github.com/openjdk/jdk/pull/19320#issuecomment-2144900070
>> With the jmh test data, we see that there is a performance decrease from testNegative55 to testNegative64 when zbb is not available. This is because a loop is needed to count the number of 1 when Zbb is not available. Therefore, the current patch is only optimized when Zbb is available. What do you think?
>
>> > Disabling `UseSecondarySupersTable` is probably not a good idea.
>> > https://github.com/openjdk/jdk/blob/48621ae193ef70b2fae4dcb7ddc524f349beb131/src/hotspot/cpu/x86/macroAssembler_x86.cpp#L4743
>> >
>> > is a better and easier way to handle this situation.
>>
>> Hi, The same question has been raised before. Here is the implementation and test data using scalar registers. [#19320 (comment)](https://github.com/openjdk/jdk/pull/19320#issuecomment-2144900070) With the jmh test data, we see that there is a performance decrease from testNegative55 to testNegative64
>
> Such huge numbers of secondary supers don't occur in real-world code.
>
>> when zbb is not available. This is because a loop is needed to count the number of 1 when Zbb is not available. Therefore, the current patch is only optimized when Zbb is available. What do you think?
>
> Please do that test again with -XX:-UseSecondarySupersCache. There is a problem I don't quite understand which causes the benchmark to use the existing secondary_super_cache, and this gives results that are misleading.
I think I may have found the problem: the warmup loop doesn't run for long enough on some machines. Can you try something like `-wi 10` ?
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/19320#discussion_r1645908089
More information about the hotspot-dev
mailing list