On Sat, 22 Nov 2025 08:37:39 GMT, Serguei Spitsyn <[email protected]> wrote:
>> src/hotspot/share/runtime/mountUnmountDisabler.cpp line 147:
>>
>>> 145: MonitorLocker ml(VTMSTransition_lock);
>>> 146: while (is_start_transition_disabled(current, vth())) {
>>> 147: ml.wait(200);
>>
>> I see a lot of timed-waits throughout this code. Is that because we poll
>> rather than synchronizing properly? All this potential busy-waiting is
>> surely going to cause performance glitches.
>
> The timeouts are for reliability purposes only. Technically, they are not
> needed and can be removed after this code becomes stable. The `wait()` calls
> are inside while loop which rechecks the loop-ending conditions.
I tried to minimize the changes with respect to the current code so I kept the
timed-waits. As Serguei points out we should be able to remove this particular
one. As for the ones executed by the disablers, we could make them poll for the
transition bits in a loop with backoff, similar to how we do it in safepoint
and handshake cases. But I agree with Serguei we should do it in a separate bug
once the code is stable.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/28361#discussion_r2561204423