RFR: 8186670: Implement _onSpinWait() intrinsic for AArch64 [v10]
Evgeny Astigeevich
duke at openjdk.java.net
Thu Oct 14 20:12:45 UTC 2021
On Mon, 11 Oct 2021 20:17:36 GMT, Evgeny Astigeevich <duke at openjdk.java.net> wrote:
>> This PR is a follow-up on the discussion [“RFC: AArch64: Implementing spin pauses with ISB”](https://mail.openjdk.java.net/pipermail/hotspot-dev/2021-August/054033.html).
>>
>> It adds DIAGNOSTIC options `OnSpinWaitInst=inst`, where `inst` can be:
>>
>> - `none`: no implementation for spin pauses. This is the default value.
>> - `nop`: use `nop` instruction for spin pauses.
>> - `isb`: use `isb` instruction for spin pauses.
>> - `yield`: use `yield` instruction for spin pauses.
>>
>> And `OnSpinWaitInstCount=count`, where `count` specifies a number of `OnSpinWaitInst` and can be in `1..99` range. It is an error to use `OnSpinWaitInstCount` when `OnSpinWaitInst` is `none`.
>>
>> The code for the `Thread.onSpinWait` intrinsic is generated based on the values of `OnSpinWaitInst` and `OnSpinWaitInstCount`.
>>
>> Testing:
>>
>> - `make test TEST="gtest"`: Passed
>> - `make run-test TEST="tier1"`: Passed
>> - `make run-test TEST="tier2"`: Passed
>> - `make run-test TEST=hotspot/jtreg/compiler/onSpinWait`: Passed
>>
>> CSR: https://bugs.openjdk.java.net/browse/JDK-8274564
>
> Evgeny Astigeevich has updated the pull request incrementally with one additional commit since the last revision:
>
> Make OnSpinWaitInst/OnSpinWaitInstCount DIAGNOSTIC
Results:
- 1 `isb`
Benchmark (maxNum) Mode Cnt Score Error Units
ThreadOnSpinWait.count:withOnSpinWait 1000000 avgt 10 18.029 ± 0.001 ms/op
ThreadOnSpinWait.count:withSleep0 1000000 avgt 10 337.506 ± 2.530 ms/op
ThreadOnSpinWait.count:withoutPause 1000000 avgt 10 2.663 ± 0.073 ms/op
- 1 `yield`
Benchmark (maxNum) Mode Cnt Score Error Units
ThreadOnSpinWait.count:withOnSpinWait 1000000 avgt 10 2.667 ± 0.069 ms/op
ThreadOnSpinWait.count:withSleep0 1000000 avgt 10 339.933 ± 4.954 ms/op
ThreadOnSpinWait.count:withoutPause 1000000 avgt 10 2.677 ± 0.075 ms/op
-------------
PR: https://git.openjdk.java.net/jdk/pull/5562
More information about the hotspot-dev
mailing list