RFR: 8366441: AArch64: Support WFET in OnSpinWait

Ruben duke at openjdk.org
Mon Feb 9 21:34:02 UTC 2026


On Mon, 1 Sep 2025 14:36:40 GMT, Andrew Haley <aph at openjdk.org> wrote:

>> Implement OnSpinWait based on WFET - wait for event with timeout:
>>  - introduce OnSpinWaitDelay - the OnSpinWait time in nanoseconds;
>>  - the OnSpinWaitInstCount is expected to be 1 when WFET is used;
>>  - the waiting loop is followed by SB - to ensure following instructions aren't speculated until wait is finished;
>>  - the timer register is read via the self-synchronized view CNTVCTSS_EL0 to prevent the read being hoisted out of the loop.
>> 
>> The WFET and CNTVCTSS_EL0 read are added to aarch64-asmtest.py as hex values - using the instruction mnemonics would require support of -march=armv9-2.a, and consequently, the binutils 2.36+.
>
>> The WFET and CNTVCTSS_EL0 read are added to aarch64-asmtest.py as hex values - using the instruction mnemonics would require support of -march=armv9-2.a, and consequently, the binutils 2.36+.
> 
> So please use binutils 2.36+.

Thank you for the feedback, @theRealAph. I have updated the PR accordingly. I've also set the default `OnSpinWaitDelay` to 100 which appears preferable based on the above performance data. I would appreciate if you could take another look.

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

PR Comment: https://git.openjdk.org/jdk/pull/27030#issuecomment-3863038906


More information about the hotspot-dev mailing list