Skip to content

8359435: AArch64: add support for 8.5 SB instruction #25801

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

eastig
Copy link
Member

@eastig eastig commented Jun 13, 2025

Speculation Barrier (SB) instruction can be used instead of a pair of DSB, ISB if supported. It should have better performance than DSB+ISB (https://developer.arm.com/documentation/102825/0100):

... a DSB+ISB sequence is expected to have a significantly greater impact on performance than an SB ...

CPUs supporting it:

  • Apple M2+
  • Neoverse-N2
  • Neoverse-V2

Tested:

  • Gtests passed

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-8359435: AArch64: add support for 8.5 SB instruction (Enhancement - P4)

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 25801

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

Using diff file

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

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Jun 13, 2025

👋 Welcome back eastigeevich! 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 Jun 13, 2025

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

@openjdk openjdk bot added the rfr Pull request is ready for review label Jun 13, 2025
@openjdk
Copy link

openjdk bot commented Jun 13, 2025

@eastig The following label will be automatically applied to this pull request:

  • hotspot-compiler

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

@eastig
Copy link
Member Author

eastig commented Jun 13, 2025

Hi @theRealAph ,
Could you please take a look?

@mlbridge
Copy link

mlbridge bot commented Jun 13, 2025

Webrevs

@theRealAph
Copy link
Contributor

I think this can wait until we have a use for SB.

@eastig
Copy link
Member Author

eastig commented Jun 13, 2025

The case is to use it for spin pauses instead of ISB on Neoverse-N2/V2.
There is data SB-based spin pauses are less disruptive then ISB-based one on them, so performance is better:

There are discussions regarding using it for spin pauses:

Do you think it is better to have a PR combining this PR and use of SB for spin pauses?

@eastig
Copy link
Member Author

eastig commented Jun 13, 2025

BTW Arm published a post in their blog about different implementations of spin pauses: https://community.arm.com/arm-community-blogs/b/architectures-and-processors-blog/posts/multi-threaded-applications-arm
A high accuracy delay requires FEAT_SB (Armv8.5-A), FEAT_ECV (Armv8.6-A) and FEAT_WFxT (Armv8.7-A).

@shipilev
Copy link
Member

FWIW, I don't mind the SB assembler support to go under this, separate PR. We sometimes do it to split the work in the series of atomic commits, where the commit like this should certainly be non-regressing. The actual use of SB (spin-pauses) can then come under separate RFE, and would require much more work (and have associated risk).

So, it would be tad less confusing if we had a dependent RFE for using SB in spin pauses, so it was obvious why do we need it.

@theRealAph
Copy link
Contributor

Do you think it is better to have a PR combining this PR and use of SB for spin pauses?

Yes, definitely, otherwise we're pushing dead code. Thanks.

@theRealAph
Copy link
Contributor

So, it would be tad less confusing if we had a dependent RFE for using SB in spin pauses, so it was obvious why do we need it.

Huh? The least confusing is when the SB support goes in the PR where it is used. That really is obvious, without any dependency chain.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hotspot-compiler [email protected] rfr Pull request is ready for review
Development

Successfully merging this pull request may close these issues.

3 participants