-
Notifications
You must be signed in to change notification settings - Fork 6.2k
8371649: ZGC: AArch64: redundant OrderAccess::fence in ZBarrierSetAssembler::patch_barrier_relocation #28244
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
…r::patch_barrier_relocation
|
👋 Welcome back eastigeevich! A progress list of the required criteria for merging this PR into |
|
@eastig 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 28 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. ➡️ To integrate this PR with the above commit message to the |
|
Hi Andrew(@theRealAph), |
|
Thank you, @theRealAph |
That's fascinating, thanks. |
|
Hi Erik (@fisk), |
The way I look at it, the fence was there for hardware that is unsophisticated enough to require manual cache flushing instead of having cache coherency that understands instruction edits, and at the same time has unsophisticated enough fences that are not speculated across such that the buffered store hits the cache before invalidating the cache, and not after, which would be awkward. It is certainly possible that in practice the cache invalidation facilities also do the right level of fencing. So this is mostly just defensive programming. If I flip the question around - how confident do you feel on a scale from 1 to 10 that the cache invalidation mechanism guarantees across all implementations, that the preceding store is flushed out to the caches before the cache is flushed? This is an area of the code where I don't want to take chances and slip unless we feel a high level of confidence. |
[edited] Understood. But there are two caches, and On the other hand, the cost of |
Such hardware would violate Arm ARM:
Yes, it might be a bug in hardware. Neoverse-N1 errata 1542419 is a good example.
The issue is that we don't have this fence at other places, where
10, if we assume correct AArch64 implementation and correct
This change is not about performance. It's about logical inconsistency: not using this everywhere, absence of history and contradiction to Arm ARM. Also, an assumption of a needed fence complicates a fix of JDK-8370947. See |
I see. So there is little or no performance benefit, but we're doing this for reasons of formal consistency.
I guess so, but there is no assumption of a needed fence. A question is whether some future Arm system with fully-coherent i- and d-caches might want to supply a weaker version of |
|
@fisk , I'm assuming that no other thread is executing the target instructions while were patching them. |
Indeed; no concurrent thread is executing the instructions being modified. |
The instruction cache maintenance function internally handles any required barriers.
This means we don't need any barriers before calling it.
This PR removes a redundant OrderAccess::fence in ZBarrierSetAssembler::patch_barrier_relocation.
Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/28244/head:pull/28244$ git checkout pull/28244Update a local copy of the PR:
$ git checkout pull/28244$ git pull https://git.openjdk.org/jdk.git pull/28244/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 28244View PR using the GUI difftool:
$ git pr show -t 28244Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/28244.diff
Using Webrev
Link to Webrev Comment