RFR: 8324881: ObjectSynchronizer::inflate(Thread* current...) is invoked for non-current thread [v4]
Richard Reingruber
rrich at openjdk.org
Thu Feb 1 12:52:04 UTC 2024
On Thu, 1 Feb 2024 10:59:19 GMT, Axel Boldt-Christmas <aboldtch at openjdk.org> wrote:
>> src/hotspot/share/runtime/objectMonitor.cpp line 330:
>>
>>> 328: assert(_recursions == 0, "invariant");
>>> 329: success = true;
>>> 330: } else if (prev_owner == locking_thread) {
>>
>> I thought you would have to handle `LockingMode == LM_LEGACY && locking_thread->is_lock_owned((address)prev_owner) == true`. Could this cause the timeouts?
>>
>> (EDIT: fixed copy/past mistake in expression)
>
> It is the ` -XX:LockingMode=0 -Xlog:monitorinflation=trace ` that timeout.
> You are correct that this case should also be handled.
> No tests reach this point. But it should still be reachable. The re-lock code will never cause inflation, but it might relock a lock which was inflated by the current thread (due to hash code) and then relock calls `enter_for`
This test triggers the case where `prev_owner` is a stack lock with `LM_LEGACY` https://github.com/openjdk/jdk/compare/master...reinrich:jdk:tmp2.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/17626#discussion_r1474412703
More information about the hotspot-dev
mailing list