-
Notifications
You must be signed in to change notification settings - Fork 97
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
8320379: C2: Sort spilling/unspilling sequence for better ld/st merging into ldp/stp on AArch64 #665
Conversation
👋 Welcome back pengxiaolong! A progress list of the required criteria for merging this PR into |
@pengxiaolong 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 19 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 |
This backport pull request has now been updated with issue from the original commit. |
|
Webrevs
|
Did you submit a jdk22 backport request? |
This issue is fixed in 22 originally, so no JDK 22u backport is needed. Aside: my read of https://mail.openjdk.org/pipermail/jdk-updates-dev/2024-June/033864.html is that 22u is effectively dead anyway. |
OK.
Ah, right. I didn't see that. This is a pretty minor performance tweak, so it's marginal whether it should be back ported. I'm not sure the churn is justified. |
True. That said, lots of these papercut issues enjoy massive multipliers with our large fleets, so we prefer to patch up these minor inefficiencies as we go. :) |
Thanks @theRealAph and @shipilev for the review and discussion. We have very large AArch64 fleet in our prod, which magnifies the minor performance improvements. |
/approval request Backport to jdk21 to improve performance on AArch64, I have verified the the code by running all the tests, few failures not related to this build(details in PR); Applies cleanly. Risk should be low, JDK-8320379 was merged over 6 months ago w/o known issue/bug so far. |
@pengxiaolong |
I understand that, but wouldn't that apply to all minor performance improvements? And wouldn't the direct consequence of following that principle to its conclusion be that if anyone wanted a stable release, too bad: there isn't a stable release? I totally get why this low-risk fix is a good thing, but... |
Well, we don't have to drive that principle to conclusion. There are always changes in releases, and I believe that JDK 21 is the most fluid one at the moment, while JDK 8 is the most rigid one. It does not mean we don't do JDK 8 changes at all, though, so even that rigidity is not absolute. There is always cost-benefit calculation in every backport. The little cost for backporting, testing, and future tracking is already taken by @pengxiaolong. We reap a little benefit for it in exchange. We do this in release that is an enticing migration target for LTS-tracking projects, giving migration a little more edge. What's not to like? |
Mailing list message from Andrew Haley on jdk-updates-dev: On 6/7/24 18:09, Aleksey Shipilev wrote:
OK, fine. I was just checking. The "thousand paper cuts" argument made me think of "a thousand backports." :-)
So if there's a cost-benefit argument to be made, then feature backport PRs (as opposed to bug fixes) should at least make the argument. It is not obvious to me where the cost-benefit argument lands in this case. Bug fixes are different, I think. -- |
Out of my own curiosity, did the following test to confirm my gut feelings about this patch:
In other words, on this trivial workload, this saves us ~0.15% of code cache. If this holds for larger apps, this amounts at about 192K for 128M code cache. This looks like a benefit enough for the cost of this backport :) It would, of course, impact even higher when we miss |
So this is the kind of argument that should have been made. It's not quite obvious that it'll help a hot path, though. ARMv8.4 made a change that makes LDP and STP atomic in some cases (see "Changes to single-copy atomicity in Armv8.4"). While this is very useful, it is a behavioural change. I'm guessing that there won't be any regressions for spills and fills, because stack-local accesses are uncontended. |
True. Are you satisfied with it?
Yup. I expect that if LDP/STP merging becomes problematic on some platforms, the merging code would somehow account for that. This seems orthogonal to what this patch is doing. |
Yes, I think so. It's remarkably effective for such a simple optimization. |
Thank you @theRealAph and @shipilev for the review/discussion/argument, it is a good learning! I"ll start to integrate. |
/integrate |
@pengxiaolong |
/sponsor |
Going to push as commit a86d042.
Your commit was automatically rebased without conflicts. |
@shipilev @pengxiaolong Pushed as commit a86d042. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
Backport JDK-8320379: C2: Sort spilling/unspilling sequence for better ld/st merging into ldp/stp on AArch64
Validation
Tested on AWS Graviton instance by running
JTREG_KEYWORDS="\!headful & \!external-dep & \!printer" make test TEST=all
, same the test for PR on jdk17, only saw few test failures in CAInterop.java and compiler/intrinsics.Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk21u-dev.git pull/665/head:pull/665
$ git checkout pull/665
Update a local copy of the PR:
$ git checkout pull/665
$ git pull https://git.openjdk.org/jdk21u-dev.git pull/665/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 665
View PR using the GUI difftool:
$ git pr show -t 665
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk21u-dev/pull/665.diff
Webrev
Link to Webrev Comment