-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
8322957: Generational ZGC: Relocation selection must join the STS #17368
8322957: Generational ZGC: Relocation selection must join the STS #17368
Conversation
/label add hotspot |
/contributor add @xmas92 |
👋 Welcome back stefank! A progress list of the required criteria for merging this PR into |
@stefank |
@stefank |
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.
Looks good.
@stefank 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 77 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 |
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.
Tier1-7 passes. |
/integrate |
Going to push as commit ba23025.
Your commit was automatically rebased without conflicts. |
The concurrent ZGC threads don't automatically participate in the safepoint protocol, which means that they can run concurrently with safepoint VM Operations. Instead they use other means to hook into the safepoint protocol whenever they need to make changes that could be racing with the various VM Operations. The most common way is to join the "suspendible thread set". For details around this see
SafepointSynchronize::begin
and the call toUniverse::heap()->safepoint_synchronize_begin()
.It turns out that the relocation selection phase was updated to use a call oop_iterate, to modify oops of some of the objects. This was done without having the GC threads join the suspendible thread set. This means that various VM Operations could run concurrently with the oop_iterate. This caused the failure described in JDK-8322957: The JFR Leak Profiler modified the object header bits, while the GC's oop_iterate function used the same bits to determine if the oop iteration over an object should be skipped. This lead to objects not being modified as they were supposed to, which lead to broken oops and asserts.
The fix is quite small and could be limited to the lines added to src/hotspot/share/gc/z/zRelocationSet.cpp. However, to lower the risk of reintroducing a bug like this again, we've added extra verification code. Some of the infrastructure to get the correct verification is placed outside of the GC code, and that's why this PR is sent to the hotspot-dev list.
This has been tested with the reproducer of the original bug + tier1-7 on linux-x64-debug.
Progress
Issue
Reviewers
Contributors
<aboldtch@openjdk.org>
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/17368/head:pull/17368
$ git checkout pull/17368
Update a local copy of the PR:
$ git checkout pull/17368
$ git pull https://git.openjdk.org/jdk.git pull/17368/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 17368
View PR using the GUI difftool:
$ git pr show -t 17368
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/17368.diff
Webrev
Link to Webrev Comment