-
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
8324186: Use "dmb.ishst+dmb.ishld" for release barrier #17511
Conversation
👋 Welcome back kuaiwei! A progress list of the required criteria for merging this PR into |
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.
I wonder if this was tested on other vendors' hardware? I witnessed some negative impact at least on HiSilicon TSV110 running the same JMH. So I guess it might be safer to go as a vendor-specific change.
Before:
Benchmark Mode Cnt Score Error Units
FinalFieldInitialize.testAllocWithFinal thrpt 9 840.267 ? 69.505 ops/s
After:
Benchmark Mode Cnt Score Error Units
FinalFieldInitialize.testAllocWithFinal thrpt 9 732.791 ? 47.198 ops/s
Could we instead make the last store to a final field in a constructor an STLR and remove the release barrier? |
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.
Very nice. Thanks.
It's possible, but it would be more work. |
That's interesting, but I guess it's only 14% on a microbenchmark which is intended to stress this as much as possible. Do we have any idea why this regresses? |
I tried a number of different machines and saw regressions only on Kunpeng-920 (same CPU?) and A57 which is quite niche at this point. |
I tried it before and failed. We can not bind the final field store with stlr, because the store which publish the new obj to heap can float above and cause trouble. It may work if bind the stlr with the publish store. But we may add multiple stlr. |
Thanks for test on other architecture. We may need a new arch dependent flag for it. |
test/micro/org/openjdk/bench/vm/compiler/FinalFieldInitialize.java
Outdated
Show resolved
Hide resolved
test/micro/org/openjdk/bench/vm/compiler/FinalFieldInitialize.java
Outdated
Show resolved
Hide resolved
@nick-arm : Thanks for trying it out. Yeah, TSV110 is the core micro-arch name for Kunpeng-920. @theRealAph : I don't have access to the details of TSV110 any more, I guess it's not easy to figure out what's going on :-( |
Right, so it's probably a low-end, mostly-in-order thing. That makes sense because we're trading a weaker barrier for more instructions, and perhaps some cores implement barriers in a crude one-size-fits-all way. |
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.
LGTM. Thanks.
@kuaiwei This pull request has not yet been marked as ready for integration. |
@kuaiwei 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 60 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 (@RealFYang, @theRealAph) but any other Committer may sponsor as well. ➡️ To flag this PR as ready for integration with the above commit message, type |
/integrate |
@theRealAph @RealFYang Could you help to sponsor it? Thanks |
/sponsor |
Going to push as commit 628348d.
Your commit was automatically rebased without conflicts. |
@theRealAph @kuaiwei Pushed as commit 628348d. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
This introduced a performance regression, see JDK-8325449 and JDK-8325269. @kuaiwei, could you please have a look? |
I missed the message. I will look these issues. |
Details is https://mail.openjdk.org/pipermail/hotspot-compiler-dev/2024-January/071921.html.
Using a combined dmb.ish for release barrier will introduce a heavy storeload barrier. Use "dmb.ishst+dmb.ishld" pair instead, we can gain performance improvement on N1 and N2 architecture. The benchmark is test/micro/org/openjdk/bench/vm/compiler/FinalFieldInitialize.java
Run with ParallelGC to minimalize impact of gc barrier.
Without the patch
FinalFieldInitialize.testAllocWithFinal thrpt 9 1214.575 ? 14.217 ops/s
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/17511/head:pull/17511
$ git checkout pull/17511
Update a local copy of the PR:
$ git checkout pull/17511
$ git pull https://git.openjdk.org/jdk.git pull/17511/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 17511
View PR using the GUI difftool:
$ git pr show -t 17511
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/17511.diff
Webrev
Link to Webrev Comment