Skip to content

Conversation

@ruben-arm
Copy link
Contributor

@ruben-arm ruben-arm commented Sep 1, 2025

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+.


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8366441: AArch64: Support WFET in OnSpinWait (Enhancement - P4)

Contributors

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/27030/head:pull/27030
$ git checkout pull/27030

Update a local copy of the PR:
$ git checkout pull/27030
$ git pull https://git.openjdk.org/jdk.git pull/27030/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 27030

View PR using the GUI difftool:
$ git pr show -t 27030

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/27030.diff

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+.

Co-authored-by: Stuart Monteith <[email protected]>
@bridgekeeper
Copy link

bridgekeeper bot commented Sep 1, 2025

👋 Welcome back ruben-arm! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented Sep 1, 2025

❗ This change is not yet ready to be integrated.
See the Progress checklist in the description for automated requirements.

@openjdk
Copy link

openjdk bot commented Sep 1, 2025

@ruben-arm The following labels will be automatically applied to this pull request:

  • graal
  • hotspot

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing lists. If you would like to change these labels, use the /label pull request command.

@ruben-arm
Copy link
Contributor Author

/contributor add @stooart-mon

@openjdk
Copy link

openjdk bot commented Sep 1, 2025

@ruben-arm
Contributor Stuart Monteith <[email protected]> successfully added.

@theRealAph
Copy link
Contributor

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+.

@bridgekeeper
Copy link

bridgekeeper bot commented Oct 27, 2025

@ruben-arm This pull request has been inactive for more than 8 weeks and will be automatically closed if another 8 weeks passes without any activity. To avoid this, simply issue a /touch or /keepalive command to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

@ruben-arm
Copy link
Contributor Author

/keepalive

@openjdk
Copy link

openjdk bot commented Oct 27, 2025

@ruben-arm The pull request is being re-evaluated and the inactivity timeout has been reset.

@openjdk
Copy link

openjdk bot commented Oct 27, 2025

@ruben-arm this pull request can not be integrated into master due to one or more merge conflicts. To resolve these merge conflicts and update this pull request you can run the following commands in the local repository for your personal fork:

git checkout pr-8366441
git fetch https://git.openjdk.org/jdk.git master
git merge FETCH_HEAD
# resolve conflicts and follow the instructions given by git merge
git commit -m "Merge master"
git push

@openjdk openjdk bot added the merge-conflict Pull request has merge conflict with target branch label Oct 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

graal [email protected] hotspot [email protected] merge-conflict Pull request has merge conflict with target branch

Development

Successfully merging this pull request may close these issues.

2 participants