RFR: 8343840: Rewrite the ObjectMonitor lists [v2]
Fredrik Bredberg
fbredberg at openjdk.org
Thu Feb 27 16:00:14 UTC 2025
On Thu, 27 Feb 2025 14:09:45 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:
>> Fredrik Bredberg has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Update after review by David and Coleen.
>
> src/hotspot/share/runtime/objectMonitor.cpp line 701:
>
>> 699: void ObjectMonitor::add_to_entry_list(JavaThread* current, ObjectWaiter* node) {
>> 700: node->_prev = nullptr;
>> 701: node->TState = ObjectWaiter::TS_ENTER;
>
> I think you should do this in a future cleanup. The ObjectWaiter's constructor should initialize these fields to TS_ENTER or TS_WAIT when it's created and make prev, next null (or 0xBAD?). And fix the constructor to have an initialization list instead.
Sounds like a plan.
> src/hotspot/share/runtime/synchronizer.cpp line 369:
>
>> 367: // We have one or more waiters. Since this is an inflated monitor
>> 368: // that we own, we can transfer one or more threads from the waitset
>> 369: // to the entry_list here and now, avoiding the slow-path.
>
> Not related to this change but I found that this quick_notify isn't quicker.
Let's make quick_notify quicker (in another RFE).
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/23421#discussion_r1973883699
PR Review Comment: https://git.openjdk.org/jdk/pull/23421#discussion_r1973878764
More information about the hotspot-dev
mailing list