-
Notifications
You must be signed in to change notification settings - Fork 6.2k
8271579: G1: Move copy before CAS in do_copy_to_survivor_space #4983
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
Conversation
|
👋 Welcome back mli! A progress list of the required criteria for merging this PR into |
|
@Hamlin-Li 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
|
|
Amazing. |
|
Sounds like a good idea. Only doing prefetch immediately before copy looks odd, but this may be a different topic. |
kimbarrett
left a comment
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.
Any explanation for why this has a significant impact?
|
Not quite sure, it could be related to the pipeline scheduling at CPU level. |
|
We are currently trying to reproduce these improvements on aarch64 and x64. Also, please revert the change to the age calculation and file this separately. I think I remember the reason for incrementing the age the way it is done is/was that it is supposed to avoid some forced reloads of the mark word which may or may not be important. Either way it is completely unrelated to this change. |
9160187 to
997fdc1
Compare
|
I see, just reverted the code related to age which is now tracked by https://bugs.openjdk.java.net/browse/JDK-8272070 |
|
What type of machine are you using to get that result? We tested SPECjbb on AWS M6g but couldn't see any significant difference in critical jops. |
|
Thanks for the testing, and feedback. setting in run_multi.sh of specjbb2015: GROUP_COUNT=4 my test env is as below: $ uname -a $ lscpu |
|
@tschatzl Hi Thomas, may I ask how's test result on aarch64 and x64? |
|
Sorry for the wait, but actually my testing just finished today - I initially had a few issues (needing to redo a few times, and due to the results re-testing to get better results), but I could not see any statistically significant difference in either maxjops or criticaljops (or any other benchmark I have tested) with Oracle cloud instances with Ampere Altra (dual-socket) machines at this time. Also tried just running on a single socket. There is no discernible difference on x64 either. I will discuss this with others how to proceed today; personally it may be worth aligning the code with Parallel GC anyway. |
|
Thanks for the feedback. Please kindly let me know your discussion result. |
|
So we talked about this internally, and standalone it does not seem to be worth adding given that the gain you report is not reproducable on multiple (current) systems, and together we were not able to come up with an explanation why this suggested order of copy/cas would be better. However it also enables further code improvements by simplifying (mark word) code. So we think that if this change and the mark word change suggested earlier together are at least performance-neutral (which is likely imo), we are going to take in both changes. I'll start some perf runs with both changes applied (I'll just manually re-apply the mark word change you suggested earlier). Hth, |
|
This is the code I'm using: https://github.com/openjdk/jdk/compare/master...tschatzl:mark-word-cleanup-copy-cas?expand=1 |
|
Thanks Thomas, then I'll wait for your perf result. |
tschatzl
left a comment
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; perf results with the mark word change (see earlier) look good, i.e. no particular perf changes. Please wait for a second review.
|
@Hamlin-Li 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 348 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 |
|
/issue add JDK-8272070 |
|
@Hamlin-Li |
|
@Hamlin-Li |
|
Kindly reminder, I think I still need another reviewer? |
|
There are two reviews (from me and @albertnetymk), and Kim's question about the reasons do not seem relevant any more, so this is good to go imho. |
|
Thanks Thomas, I just saw Albert has been a reviewer too. |
|
/integrate |
|
Going to push as commit d874e96.
Your commit was automatically rebased without conflicts. |
|
@Hamlin-Li Pushed as commit d874e96. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
|
Just for clarification: the default requirements for a change in the gc-team to integrate is to have at least two "r"eviewers (note the lowercase r - those are people that approved it regardless of role), at least one of which must be a "R"eviewer, i.e. has the openjdk reviewer role (and there are no other open questions/comments). So that formal requirement had already been fulfilled by me and Albert without Albert being a "R"eviewer. |
Propose to move copy before CAS in do_copy_to_survivor_space, as we found this will improve G1 performance. Specjbb shows 3.7% in critical on aarch64, no change in max.
After this change copy_to_survivor in G1 is also aligned with PS's copy_to_survivor.
Progress
Issues
Reviewers
Contributors
<mashoubing1@huawei.com>Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/4983/head:pull/4983$ git checkout pull/4983Update a local copy of the PR:
$ git checkout pull/4983$ git pull https://git.openjdk.java.net/jdk pull/4983/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 4983View PR using the GUI difftool:
$ git pr show -t 4983Using diff file
Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/4983.diff