RFR: 8362193: Re-work MacOS/AArch64 SpinPause to handle SB [v3]
Andrew Haley
aph at openjdk.org
Wed Jul 23 08:45:57 UTC 2025
On Tue, 22 Jul 2025 22:41:32 GMT, Evgeny Astigeevich <eastigeevich at openjdk.org> wrote:
>> For the default YIELD we have:
>> - Original: ~250 clocks
>> - Compiler binary search tree: ~200 clocks (-20%)
>> - Optimized with `TBZ`: ~150 clocks (-40%)
>
> I think the differences might be smaller on the real hardware. Maybe everything will be around 200 clocks.
> If we need code easy to maintain then this is `switch`. If we need performance then this is `tbz`.
> Also, I did quite a lot of performance measurements before I settled on the assembler solution. Have you made any comparison before and after changing from the assembler code to the new c++ code? If so what tests did you run? Since the code is called in tight locking loops, this code really matters.
Given that this routine is a backoff delay, it's not clear that speeding it up helps.
However, if we really wanted to speed this up we'd use an indirect branch to one of four code blocks: `isb; ret` would be one of them. But I don't think we do want to speed it up.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/26387#discussion_r2224842183
More information about the hotspot-dev
mailing list