RFR: 8352256: ObjectSynchronizer::quick_notify misses JFR event notification path [v3]
Markus Grönlund
mgronlun at openjdk.org
Tue Apr 1 21:11:21 UTC 2025
On Tue, 25 Mar 2025 09:15:38 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`
>
> Aleksey Shipilev has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains three commits:
>
> - Merge branch 'master' into JDK-8352256-quick-notify-jfr
> - Review comment
> - Fix
Changes requested by mgronlun (Reviewer).
src/hotspot/share/runtime/objectMonitor.cpp line 2054:
> 2052: }
> 2053:
> 2054: quick_notifyAll(current);
When the regular versions end up also using the quick versions, a distinction has been lost in translation - is the only difference that the regular versions enter _thread_in_vm, whereas the quick versions enter _thread_in_java? If there is no real difference, consider eliminating the quick versions and referring directly to the regular versions.
>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.
src/hotspot/share/runtime/synchronizer.cpp line 378:
> 376: DTRACE_MONITOR_PROBE(notify, mon, obj, current);
> 377: }
> 378: do {
Is this loop included in the refactored version? I guess it is.
-------------
PR Review: https://git.openjdk.org/jdk/pull/24097#pullrequestreview-2734014990
PR Review Comment: https://git.openjdk.org/jdk/pull/24097#discussion_r2023676611
PR Review Comment: https://git.openjdk.org/jdk/pull/24097#discussion_r2023657024
More information about the hotspot-runtime-dev
mailing list