Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8322535

Change default AArch64 SpinPause instruction

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 23
    • 22
    • hotspot
    • b09
    • aarch64
    • linux, os_x

      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 but JDK-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 in JDK-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").

            fbredberg Fredrik Bredberg
            fbredberg Fredrik Bredberg
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: