-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
8324050: Issue store-store barrier after re-materializing objects during deoptimization #17503
Conversation
…ing deoptimization
👋 Welcome back kvn! A progress list of the required criteria for merging this PR into |
Webrevs
|
// These objects may escape when we return to Interpreter after deoptimization. | ||
// We need barrier so that stores that initialize these objects can't be reordered | ||
// with subsequent stores that make these objects accessible by other threads. | ||
OrderAccess::storestore(); |
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.
This seems like the right place for normal deoptimization, but I'm worried that EscapeBarrier::deoptimize_objects() makes these objects visible to JVMTI without calling reassign_fields().
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 see that EscapeBarrier::deoptimize_objects_internal()
calls Deoptimization::deoptimize_objects_internal()
which calls rematerialize_objects()
which does reallocation and fields reassignment. It will execute this barrier.
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, I missed that.
@vnkozlov 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 16 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 |
This seems similar to a recent discussion. There, it is decided that a release barrier would be safer. Should we do it similarly here? Thanks. |
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.
It looks good, but let's not put unrelated changes together? I think the COMPILER2_OR_JVMCI
should come in as a separate atomic change. This will, for example, allow to cleanly backport storestore
additions without looking back whether the vector support enablement hunks make sense.
I think, if decided, it should be done in separate RFE uniformly in all places: Interpreter, C1, C2 and here in deoptimization code. |
Thank you, Aleksey Right, backports. I removed |
Thank you, Dean, Aleksey and Quan for reviews and comments. |
/integrate |
Going to push as commit 52523d3.
Your commit was automatically rebased without conflicts. |
That would be the wrong thing to do, because the risk that leads us (possibly? - discuss) to need release can only happen in an optimizing compiler. AFAIK... |
Added missing store-store barrier when we re-materialize scalar replaced object during deoptimization.
I also removed redundant
#if COMPILER2_OR_JVMCI
guards which were leftover from JDK-8312579 changes. It added Vector API support to Graal and changed#ifdef COMPILER2
to these#if
. But this code is already under theseifs
.Tested tier1-3, scope, stress.
No new regression test. I think it is "almost" impossible to hit this issue because there is a lot of VM's runtime code between the code which rematerialize scalar-replaced objects during deoptimization and a code in Interpreter which is executed after deoptimization and which may execute a store instruction that makes these objects accessible by other threads.
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/17503/head:pull/17503
$ git checkout pull/17503
Update a local copy of the PR:
$ git checkout pull/17503
$ git pull https://git.openjdk.org/jdk.git pull/17503/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 17503
View PR using the GUI difftool:
$ git pr show -t 17503
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/17503.diff
Webrev
Link to Webrev Comment