RFR: 8186670: Implement _onSpinWait() intrinsic for AArch64 [v2]

Andrew Haley aph at openjdk.java.net
Tue Sep 21 08:17:44 UTC 2021


On Mon, 20 Sep 2021 16:21:38 GMT, Evgeny Astigeevich <github.com+42899633+eastig at openjdk.org> 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 the option `UsePauseImpl=value`, where `value` can be:
>> 
>> - `none`: no implementation for spin pauses. This is the default value.
>> - `Nnop`: use `nop` instruction for spin pauses. Optional `N` can be `2..9` to specify a number of `nop` instructions.
>> - `Nisb`: use `isb` instruction for spin pauses. Optional `N` can be `2..9` to specify a number of `isb` instructions.
>> - `Nyield`: use `yield` instruction for spin pauses. Optional `N` can be `2..9` to specify a number of `yield` instructions.
>> 
>> The code for the `Thread.onSpinWait` intrinsic is generated based on the value of `UsePauseImpl`.
>> 
>> 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
>
> Evgeny Astigeevich has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Replace 'for' loops with macros

src/hotspot/cpu/aarch64/globals_aarch64.hpp line 114:

> 112:           "Value -1 means off.")                                        \
> 113:           range(-1, 4096)                                               \
> 114:   product(ccstr, UsePauseImpl, "none",                                  \

The name "UsePauseImpl" fails to make the connection with `onSpinWait`. If you called it something like `OnSpinWaitImpl` that would make the connection.

src/hotspot/cpu/aarch64/globals_aarch64.hpp line 115:

> 113:           range(-1, 4096)                                               \
> 114:   product(ccstr, UsePauseImpl, "none",                                  \
> 115:           "Use instructions to implement pauses."                       \

Suggestion:

          "Use instructions to implement java.lang.Thread.onSpinWait() ."                       \

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

PR: https://git.openjdk.java.net/jdk/pull/5562


More information about the hotspot-dev mailing list