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
8294538: missing is_unloading() check in SharedRuntime::fixup_callers_callsite() #10747
Conversation
|
@dean-long 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. |
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.
Seems fine.
@dean-long This change now passes all automated pre-integration checks. 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 66 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.
|
Thanks Vladimir. |
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 to me.
Thanks Tobias. |
@fisk, please take a look when you get the chance. |
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 in general, but I have two questions.
CodeBlob* cb = CodeCache::find_blob(caller_pc); | ||
if (cb == NULL || !cb->is_compiled() || entry_point == moop->get_c2i_entry()) { | ||
if (cb == NULL || !cb->is_compiled() || callee->is_unloading()) { |
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.
Why not move the is_unloading check on callee to the if statement just above that checks the callee (as opposed to the callsite)?
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 guess I was thinking is_unloading() can be a bit expensive the first time it is called, so it might be better to fail for other reasons first. But I believe is_unloading will eventually be called for every nmethod each unloading cycle, so avoiding the cost here just means moving it to somewhere else. I can move it to where you suggest if you like.
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.
Okay I see. I'll leave it to you to decide if you prefer to move it or not. I'm okay with it either way.
// Result from nmethod::is_unloading is not stable across safepoints. | ||
NoSafepointVerifier nsv; | ||
|
||
CompiledMethod* callee = moop->code(); |
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.
There is a moop->code() null check just a few lines below, so now it looks like we are reading the code pointer twice checking if it is null. Is ot enough to do that one time?
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's actually the same number of null checks as before, if you look at what from_compiled_entry_no_trampoline() used to do. But I did consider removing the 2nd check, because no matter how late we check, we can always lose the race where it becomes null right after our last check. It's harmless however, so I decided to keep it.
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.
Okay. That seems fine.
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.
Thanks Erik. |
/integrate |
Going to push as commit b5efa2a.
Your commit was automatically rebased without conflicts. |
@dean-long Pushed as commit b5efa2a. |
This change adds a missing is_unloading() check for the callee in SharedRuntime::fixup_callers_callsite() and removes from_compiled_entry_no_trampoline() because it is no longer used.
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk pull/10747/head:pull/10747
$ git checkout pull/10747
Update a local copy of the PR:
$ git checkout pull/10747
$ git pull https://git.openjdk.org/jdk pull/10747/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 10747
View PR using the GUI difftool:
$ git pr show -t 10747
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/10747.diff