-
Notifications
You must be signed in to change notification settings - Fork 6.2k
8365799: AArch64: Remove trailing DMB from cmpxchgptr for LSE #26845
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
base: master
Are you sure you want to change the base?
Conversation
👋 Welcome back spchee! A progress list of the required criteria for merging this PR into |
According to the Java SE 24 API, CompareAndExchange has the memory semantics as given by VarHandle.compareAndExchange, which has the following effects [1]: > Atomically sets the value of a variable to the newValue with the > memory semantics of setVolatile if the variable's current value, > referred to as the witness value, == the expectedValue, as accessed > with the memory semantics of getVolatile. Thus, the store-release due to setVolatile only occurs if the compare is successful. Since CASAL already satisfies these requirements, the DMB does not need to occur to ensure memory ordering in case the compare fails and a store-release does not happen. Therefore, we can remove the DMB from cmpxchgptr when LSE is enabled. We also rename it to cmpxchgptr_barrier to indicate that this method provides trailing barrier semantics (via either LSE CASAL or a DMB). The unused cmpxchgw is removed. [1] https://docs.oracle.com/en/java/javase/24/docs/api/java.base/java/lang/invoke/VarHandle.html#compareAndExchange(java.lang.Object...) Change-Id: I45b26bdd75f931ecdb436d34f24ed91de0ac31c2
@spchee This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 21 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@theRealAph) but any other Committer may sponsor as well. ➡️ To flag this PR as ready for integration with the above commit message, type |
@spchee Please do not rebase or force-push to an active PR as it invalidates existing review comments. Note for future reference, the bots always squash all changes into a single commit automatically as part of the integration. See OpenJDK Developers’ Guide for more information. |
@spchee this pull request can not be integrated into git checkout cmpxchgw_dmb
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 |
Tested and passes jcstress. |
Webrevs
|
Ok looks like there are some very recent changes to the relevant files since I last touched it. Need to fix my merge-conflict and have a look at whats changed. |
Change-Id: I74d44f711de208395bce47595fecd801564bcb54
Have fixed :) |
Not sure why you are using the specification for the Java API cmpxchg function to determine what the MacroAssembler function does?? Is this the intrinsic for the Java code? |
You're right, it is a little inaccurate to use the Java API to determine what Although looking into it more, it seems that So I propose:
|
According to the Java SE 24 API, CompareAndExchange has the memory semantics as given by VarHandle.compareAndExchange, which has the following effects [1]:
Thus, the store-release due to setVolatile only occurs if the compare is successful. Since CASAL already satisfies these requirements, the DMB does not need to occur to ensure memory ordering in case the compare fails and a store-release does not happen.
Therefore, we can remove the DMB from cmpxchgptr when LSE is enabled. We also rename it to cmpxchgptr_barrier to indicate that this method provides trailing barrier semantics (via either LSE CASAL or a DMB).
The unused cmpxchgw is removed.
[1] https://docs.oracle.com/en/java/javase/24/docs/api/java.base/java/lang/invoke/VarHandle.html#compareAndExchange(java.lang.Object...)
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/26845/head:pull/26845
$ git checkout pull/26845
Update a local copy of the PR:
$ git checkout pull/26845
$ git pull https://git.openjdk.org/jdk.git pull/26845/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 26845
View PR using the GUI difftool:
$ git pr show -t 26845
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/26845.diff
Using Webrev
Link to Webrev Comment