8352256: ObjectSynchronizer::quick_notify misses JFR event notification path#24097
8352256: ObjectSynchronizer::quick_notify misses JFR event notification path#24097shipilev wants to merge 5 commits intoopenjdk:masterfrom
Conversation
|
👋 Welcome back shade! A progress list of the required criteria for merging this PR into |
|
@shipilev 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 33 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 |
coleenp
left a comment
There was a problem hiding this comment.
This looks good. At one point, because of this lack of encapsulation, I wanted us to get rid of quick_notify because I didn't think it was quicker. This improves the encapsulation too and we can figure out if it's useful later.
Yeah, I wondered about these "quick" functions myself when doing this. I guess there is a papercut performance optimization for not re-checking the owner and waitset, which is why I opted to do |
dholmes-ora
left a comment
There was a problem hiding this comment.
The use of the quick variants is to avoid the checks that could lead to throwing an exception, as they would require that the thread be _thread_in_vm not _thread_in_java.
That said it is not clear to me that posting the event doesn't violate the requirements that the quick version must maintain: no safepoints, no blocking, no state transitions. ??
Huh, that's a good question. There is a I clicked through the JFR event commit code, and I don't think there are safepoints, indefinite blocking, or state transitions. Can we rely on this, @egahlin, @mgronlun? |
I see no new failures. There are some pre-existing bugs with JFR enabled, but nothing new. So with that, and another sweep through the code, I think we are fine. |
|
(friendly reminder) |
| return; | ||
| } | ||
|
|
||
| quick_notifyAll(current); |
There was a problem hiding this comment.
From a JFR perspective, we need threads in state VM or Java for writing events that refer to artifacts; both states are equivalent for epoch management. You can also have threads in native writing JFR events, but only if the event fields are scalars, not foreign keys. However, the thread cannot capture a stack trace.
There was a problem hiding this comment.
A JavaThread in state VM or Java running the JFR commit code will not perform a transition or block for a safepoint. It is not waitfree (yet) however because of the JfrStacktrace_lock.
There was a problem hiding this comment.
Are we keeping the NoSafepointVerifier in the quick entries?
There was a problem hiding this comment.
Are we keeping the NoSafepointVerifier in the quick entries?
Yes we do.
|
Thanks @mgronlun! @dholmes-ora, are you happy with our conclusions? |
I do not see a clear answer to this. Again just for clarity the quick versions are for use when you 100% guarantee the monitor is owned. They do not need to, and cannot, check the owner and potentially throw IMSE. |
I don't think new quick versions do. We only |
A JavaThread in state VM or Java running the JFR commit code will not perform a transition or block for a safepoint. It is not waitfree (yet) however because of the JfrStacktrace_lock. |
dholmes-ora
left a comment
There was a problem hiding this comment.
Looks good - thanks for the updates.
Lets see how this works in practice.
|
Thanks for reviews! /integrate |
|
Going to push as commit ea07e71.
Your commit was automatically rebased without conflicts. |
Noticed this while removing OM counters. When doing JDK-8351187, I apparently forgot to cover a path from
ObjectSynchronizer::quick_notify, probably due to concurrent renames. I think we can cover this gap while still simplifying the code: letObjectMonitorhandle all events, DTrace, JFR, OM stats.Additional testing:
jdk_jfrProgress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/24097/head:pull/24097$ git checkout pull/24097Update a local copy of the PR:
$ git checkout pull/24097$ git pull https://git.openjdk.org/jdk.git pull/24097/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 24097View PR using the GUI difftool:
$ git pr show -t 24097Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/24097.diff
Using Webrev
Link to Webrev Comment