RFR: 8352256: ObjectSynchronizer::quick_notify misses JFR event notification path [v2]

Aleksey Shipilev shade at openjdk.org
Thu Mar 20 08:42:45 UTC 2025


On Thu, 20 Mar 2025 06:41:32 GMT, David Holmes <dholmes at openjdk.org> wrote:

> 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 `NoSafepointVerifier` at the beginning `ObjectSynchronizer::quick_notify`, so at least the mechanical runtime checks did not fail. I'll run `all` tests with monitor notification event enabled.

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, @mgronlund?

> src/hotspot/share/runtime/synchronizer.cpp line 372:
> 
>> 370:     if (mon->first_waiter() != nullptr) {
>> 371:       // We have one or more waiters. Since this is an inflated monitor
>> 372:       // that we own, we quickly notify it here and now, avoiding the slow-path.
> 
> Suggestion:
> 
>       // that we own, we quickly notify them here and now, avoiding the slow-path.

Done!

-------------

PR Comment: https://git.openjdk.org/jdk/pull/24097#issuecomment-2739596214
PR Review Comment: https://git.openjdk.org/jdk/pull/24097#discussion_r2005061558


More information about the hotspot-runtime-dev mailing list