RFR: 8322535: Change default AArch64 SpinPause instruction

Evgeny Astigeevich eastigeevich at openjdk.org
Wed Jan 17 15:05:51 UTC 2024


On Wed, 17 Jan 2024 12:44:00 GMT, Fredrik Bredberg <fbredberg at openjdk.org> wrote:

> Maybe the most reasonable way forward is to only change the default value of OnSpinWaitInst from "none" to "yield" and NOT change it to "isb" for Apple CPUs.

Do we have anyone from Apple who can suggest a spin pause implementation?
As no real cases for Apple CPUs exists, just microbenchmarks, choosing `isb` might be premature.
IMO, even without real cases I would have chosen `isb` if it had a similar latency as the Intel `pause`. 

> We could execute a bunch of UDIV instructions with a loop-carried dependency, or cycle an xor-shift generator. That could be made to delay for any number of clock cycles, so we can delay without the side effects of an ISB.

This approach is not power efficient. In case of Neoverse `isb` have shown to use less power than any instruction executing on the CPU back-end. If Apple CPUs have the similar `isb` behaviour, it would be a reason to use `isb`.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/17430#issuecomment-1895995770


More information about the hotspot-dev mailing list