The Java options OnSpinWaitInst lets you choose which AArch64 instruction should be used in SpinPause(). Valid values are "none", "nop", "isb" and "yield".
Today this option is only available on Linux butJDK-8321371 will bring the same functionality to MacOS.
The default value for OnSpinWaitInst is unfortunately "none".
However hotspot/cpu/aarch64/vm_version_aarch64.cpp contains code that recognizes some CPUs and changes the SpinPause instruction to something better if the user hasn't used the OnSpinWaitInst option. For instance if you run a Neoverse N1, N2, V1 or V2, the default SpinPause instruction will be changed to "isb".
For reasons discussed inJDK-8321371 I think we should change the default value to "yield". I also think we should do measurements on Apple M1, M2 etc. and make sure we change the default to whatever is best for those CPUs (the same way Neoverse changes the default value to "isb").
Today this option is only available on Linux but
The default value for OnSpinWaitInst is unfortunately "none".
However hotspot/cpu/aarch64/vm_version_aarch64.cpp contains code that recognizes some CPUs and changes the SpinPause instruction to something better if the user hasn't used the OnSpinWaitInst option. For instance if you run a Neoverse N1, N2, V1 or V2, the default SpinPause instruction will be changed to "isb".
For reasons discussed in
- relates to
-
JDK-8321371 SpinPause() not implemented for bsd_aarch64/macOS
- Resolved