RFR: 8343249: [Windows] Implement SpinPause
Julian Waters
jwaters at openjdk.org
Mon Dec 2 12:03:47 UTC 2024
On Fri, 1 Nov 2024 15:46:51 GMT, Stuart Monteith <smonteith at openjdk.org> wrote:
>> SpinPause is currently not implemented on any Windows platforms, due to a lack of access to assembly in the Microsoft compiler. The YieldProcessor macro can act as a stand in for this purpose, as it compiles down to a single pause instruction on x64 (Which seems to be all that one needs to implement SpinPause in HotSpot). I am less certain about the Windows/ARM64 implementation. There, YieldProcessor compiles down to dmb ishst; yield and I am unsure whether that is a correct SpinPause implementation. If need be, I can retract the ARM64 implementation and only have this for x86
>
> The linux aarch64 code implements this as a call to a stub generated at runtime:
>
> https://github.com/openjdk/jdk/blob/5995786dbd69ed11dd1cacb2a3ac86e3e6f43ab7/src/hotspot/os_cpu/linux_aarch64/os_linux_aarch64.cpp#L411
>
> As this is using the macroassembler, etc, and not static inline assembly, I presume this could be ported to Windows.
> I don't believe "dmb ishst" gives us the result we would like. While the YIELD instruction is targeted primarily for SMT CPUs, in practice it will effectively be a NOP .
Bumping. @stooart-mon does ARM64 look good to you? Also paging for @shipilev since we were discussing about SpinPause in a different place some time ago
-------------
PR Comment: https://git.openjdk.org/jdk/pull/21781#issuecomment-2511346470
More information about the hotspot-runtime-dev
mailing list