RFR: 8362193: Re-work MacOS/AArch64 SpinPause to handle SB [v3]
Evgeny Astigeevich
eastigeevich at openjdk.org
Tue Jul 22 17:14:59 UTC 2025
On Tue, 22 Jul 2025 16:40:11 GMT, Andrew Haley <aph at openjdk.org> wrote:
>> @fbredber @theRealAph, thoughts?
>
>> @fbredber @theRealAph, thoughts?
>
> That's fine. It's supposed to be a delay, and an indirect jump won't hurt. It's a lot less disruptive than an ISB in many cases, and as far as I can tell ISB is the best we've got today.
For the default `yield`, we have the following execution paths:
1. My hand written assembly: `tbz; yield; b`
2. Compiler jump table: `cmp; b.hi; adrp; add; adr; ldrsw; add; br; yield`
3. Compiler binary search tree: `cmp; b.gt; cmp; b.eq; yield`. `cmp+b` can usually be fused. So this might be like `b.c; b.c; yield`.
IMO, `2.` should be the slowest. `3.` should be close to `1.`.
@theRealAph, what's your opinion?
@fbredber, how did you measure performance for https://github.com/openjdk/jdk/pull/16994 ? Will the compiler produced code meet performance requirements?
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/26387#discussion_r2223273644
More information about the hotspot-dev
mailing list