-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
8343541: C1: Plain memory accesses are emitted with membars with +AlwaysAtomicAccesses #22191
base: master
Are you sure you want to change the base?
Conversation
…aysAtomicAccesses
👋 Welcome back xpeng! A progress list of the required criteria for merging this PR into |
@pengxiaolong This change is no longer ready for integration - check the PR body for details. |
@pengxiaolong The following label will be automatically applied to this pull request:
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. |
Webrevs
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is a bit sad that we call volatile_field_*
when we really mean atomic. But renaming that would lead to much deeper changes. So I am okay with doing just this, thanks.
I'll fix it, it is not too deep, and they are only used by barrierSetC1.cpp |
No need. If we go down that road, we also want to rename |
You are right, checked the related code, need to update the chain deep to LIR_Assembler, I'll leave them unchanged except if it is really necessary. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/reviewers 2
C1 and C2 has different implementations for
+AlwaysAtomicAccesses
, C2 impl only guarantees atomicity hence no membars are emitted for plain memory access, but C1 treats it same as volatile access hence it emits membars. The change removes the unnecessary membars in C1 for+AlwaysAtomicAccesses
.The test have been verified by very simple JMH benchmarks to measure the latency of reading/writing long/volatile long variable 10000 times, and run with VM option
-XX:TieredStopAtLevel=3 -XX:+UnlockExperimentalVMOptions -XX:+AlwaysAtomicAccesses
:Before the fix:
After the fix:
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/22191/head:pull/22191
$ git checkout pull/22191
Update a local copy of the PR:
$ git checkout pull/22191
$ git pull https://git.openjdk.org/jdk.git pull/22191/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 22191
View PR using the GUI difftool:
$ git pr show -t 22191
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/22191.diff
Using Webrev
Link to Webrev Comment