-
Notifications
You must be signed in to change notification settings - Fork 6.2k
8343468: GenShen: Enable relocation of remembered set card tables #23170
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
8343468: GenShen: Enable relocation of remembered set card tables #23170
Conversation
|
👋 Welcome back cslucas! A progress list of the required criteria for merging this PR into |
|
@JohnTortugo 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 26 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 (@shipilev, @kdnilsen, @earthling-amzn) but any other Committer may sponsor as well. ➡️ To flag this PR as ready for integration with the above commit message, type |
|
@JohnTortugo The following labels 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 lists. If you would like to change these labels, use the /label pull request command. |
Webrevs
|
shipilev
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.
I do wonder if you can avoid a lot if not all arch-specific changes, if Shenandoah barrier set: a) does not use MacroAssembler::load_byte_map_base directly; b) returns deliberately bad pointer from byte_map_base(), so that C2 matcher would never match, and accidental use of byte_map_base() would cleanly crash.
src/hotspot/cpu/ppc/gc/shenandoah/shenandoahBarrierSetAssembler_ppc.cpp
Outdated
Show resolved
Hide resolved
|
Thanks for implementing this very important feature which already improves performance (and which will further unlock better performance when init-mark becomes a per-thread handshake in the future).
It would be great if you can include some performance numbers either in this PR or, preferably, in the JBS ticket. Thanks! |
kdnilsen
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.
Thanks for figuring out how to make all of this work. It represents a very significant improvement to the GenShen implementation.
@shipilev - are you suggesting to patch all |
Yes, I was thinking that if Shenandoah cannot use super-class But mostly I want to avoid unnecessary changes in files that are not related to Shenandoah :) |
|
@JohnTortugo this pull request can not be integrated into git checkout relocation_of_card_tables
git fetch https://git.openjdk.org/jdk.git master
git merge FETCH_HEAD
# resolve conflicts and follow the instructions given by git merge
git commit -m "Merge master"
git push |
@shipilev - Please, take a look at the latest changes when you can.
@ysramakrishna - I'm working on that! |
|
The ppc fix looks good. Thanks! I guess we should rerun tests shortly before integration. There are currently many Shenandoah issues (mostly related to GenShen). |
@TheRealMDoerr - are the issues coming from a build with this patch or something prior? |
Before this patch. We have linked the issues we found with JDK-8337511. |
|
FYI: |
|
I have run this PR through our nightly tests on all our platforms and there were no new issues. |
|
@ysramakrishna - I attached to the RFE a graph showing the reduction in init-pause duration when executing SPECJBB2015 on x86_64. |
|
Anyone has any other concern / comment ? |
kdnilsen
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.
Thanks for pulling this together. Looks great.
|
I'll take a look at this tomorrow, thanks. |
shipilev
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.
Much cleaner, thanks! I'll take another look later, but meanwhile, some comments:
src/hotspot/cpu/x86/gc/shenandoah/shenandoahBarrierSetAssembler_x86.cpp
Outdated
Show resolved
Hide resolved
shipilev
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.
Looks fine now, thanks! I have not looked deeply at card table lifecycle, so I rely on @kdnilsen and @earthling-amzn reviews here.
|
/integrate |
|
@JohnTortugo |
|
/sponsor |
|
Going to push as commit 4e1367e.
Your commit was automatically rebased without conflicts. |
|
@sendaoYan @JohnTortugo Pushed as commit 4e1367e. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
|
This seems to be break Oracle --disable-jvm-feature-shenandoahgc builds on aarch64. |
In the current Generational Shenandoah implementation, the pointers to the read and write card tables are established at JVM launch time and fixed during the whole of the application execution. Because they are considered constants, they are embedded as such in JIT-compiled code.
The cleaning of dirty cards in the read card table is performed during the
init-markpause, and our experiments show that it represents a sizable portion of that phase's duration. This pull request makes the addresses of the read and write card tables dynamic, with the end goal of reducing the duration of theinit-markpause by moving the cleaning of the dirty cards in the read card table to theresetconcurrent phase.The idea is quite simple. Instead of using distinct read and write card tables for the entire duration of the JVM execution, we alternate which card table serves as the read/write table during each GC cycle. In the
resetphase we concurrently clean the cards in the the current read table so that when the cycle reaches the nextinit-markphase we have a version of the card table totally clear. In the nextinit-markpause we swap the pointers to the base of the read and write tables. When theinit-markfinishes the mutator threads will operate on the table just cleaned in theresetphase; the GC will operate on the table that just turned the new read table.Most of the changes in the patch account for the fact that the write card table is no longer at a fixed address.
The primary benefit of this change is that it eliminates the need to copy and zero the remembered set during the init-mark Safepoint. A secondary benefit is that it allows us to replace the init-mark Safepoint with an
init-markhandshake—something we plan to work on after this PR is merged.Our internal performance testing showed a significant reduction in the duration of
init-markpauses and no statistically significant regression due to the dynamic loading of the card table address in JIT-compiled code.Functional testing was performed on Linux, macOS, Windows running on x64, AArch64, and their respective 32-bit versions. I’d appreciate it if someone with access to RISC-V (@luhenry ?) and PowerPC (@TheRealMDoerr ?) platforms could review and test the changes for those platforms, as I have limited access to running tests on them.
Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/23170/head:pull/23170$ git checkout pull/23170Update a local copy of the PR:
$ git checkout pull/23170$ git pull https://git.openjdk.org/jdk.git pull/23170/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 23170View PR using the GUI difftool:
$ git pr show -t 23170Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/23170.diff
Using Webrev
Link to Webrev Comment