RFR: 8352256: ObjectSynchronizer::quick_notify misses JFR event notification path
David Holmes
dholmes at openjdk.org
Thu Mar 20 06:44:10 UTC 2025
On Tue, 18 Mar 2025 11:42:39 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:
> Noticed this while removing OM counters. When doing [JDK-8351187](https://bugs.openjdk.org/browse/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: let `ObjectMonitor` handle all events, DTrace, JFR, OM stats.
>
> Additional testing:
> - [x] Linux x86_64 server fastdebug, `jdk_jfr`
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. ??
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.
-------------
PR Review: https://git.openjdk.org/jdk/pull/24097#pullrequestreview-2701428216
PR Review Comment: https://git.openjdk.org/jdk/pull/24097#discussion_r2004904762
More information about the hotspot-runtime-dev
mailing list