-
Notifications
You must be signed in to change notification settings - Fork 6.2k
8372738: ZGC: C2 allocation reloc promotion deopt race #28558
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
|
👋 Welcome back eosterlund! A progress list of the required criteria for merging this PR into |
|
@fisk 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 17 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 |
xmas92
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 good. A lot nice to have all the promotion barriers in one place.
| ZLiveMap _livemap; | ||
| ZRememberedSet _remembered_set; | ||
| ZMultiPartitionTracker* const _multi_partition_tracker; | ||
| volatile bool _relocate_promoted; |
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.
Could use the fancy new Atomic<bool>. But I am currently working on a patch to migrate all our volatile + AtomicAccess to Atomic, so I think we can leave it using the old style for now.
In https://bugs.openjdk.org/browse/JDK-8371200 a race was handled between flip promoting objects, their promotion barriers, tenuring threshold selection and signalling to the JIT slow path allocation code to deoptimize. It made sure that flip promoted objects are made old before a handshake with the Java threads, and ran promotion barriers to erase any raw nulls after the handshake. This order was crucial to the fix.
Now unfortunately, there is a related problem for relocate promoting objects. Such objects run the promotion barriers before the object becomes old, which is the signal for the JIT allocation slow path code to deopt. Unfortunately, the order should be the opposite, similar to flip promoted objects. I propose signalling that relocate promoting pages are marked as relocate promoted during relocation set selection, and include that as a condition for deopt in the allocation slow path. The relocation set selection runs before the handshake, hence ensuring that promotion barriers won't race with JIT compiled code that has elided barriers.
T1-5 tests look good. The test that failed before reproduces an observable issue without the fix and not after the fix.
Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/28558/head:pull/28558$ git checkout pull/28558Update a local copy of the PR:
$ git checkout pull/28558$ git pull https://git.openjdk.org/jdk.git pull/28558/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 28558View PR using the GUI difftool:
$ git pr show -t 28558Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/28558.diff
Using Webrev
Link to Webrev Comment