RFR: 8343249: [Windows] Implement SpinPause [v4]

Aleksey Shipilev shade at openjdk.org
Mon Dec 2 17:00:42 UTC 2024


On Mon, 18 Nov 2024 06:08:08 GMT, Julian Waters <jwaters 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
>
> Julian Waters has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains five commits:
> 
>  - Merge branch 'openjdk:master' into patch-13
>  - Merge branch 'master' into patch-13
>  - Swap to handwritten assembly to implement SpinPause in os_windows_aarch64.cpp
>  - YieldProcessor in os_windows_aarch64.cpp
>  - 8343249

Two things:
  1. I think we need to see if there _is_ a compelling performance reason to do this. There must be `SpinPause` benchmarks somewhere.
  2. I don't think we implement `SpinPause` for _Linux x86_, or are we?

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

PR Review: https://git.openjdk.org/jdk/pull/21781#pullrequestreview-2473321031


More information about the hotspot-runtime-dev mailing list