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

Evgeny Astigeevich duke at openjdk.java.net
Mon Oct 18 16:09:44 UTC 2021


> 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:

  Add microbenchmarks for Thread.onSpinWait
  
  ThreadOnSpinWait: latency of Thread.onSpinWait() vs Thread.sleep(0) vs
  no pause.
  ThreadOnSpinWaitProducerConsumer: producer-consumer where consumer can
  go to 1ms sleep.
  ThreadOnSpinWaitSharedCounter: threads racing to count up (code provided
  by Andrew Haley, Red Hat).

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

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/5562/files
  - new: https://git.openjdk.java.net/jdk/pull/5562/files/970d8d6f..e0331a79

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=5562&range=11
 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=5562&range=10-11

  Stats: 243 lines in 3 files changed: 204 ins; 29 del; 10 mod
  Patch: https://git.openjdk.java.net/jdk/pull/5562.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/5562/head:pull/5562

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


More information about the hotspot-dev mailing list