RFR: 8324881: ObjectSynchronizer::inflate(Thread* current...) is invoked for non-current thread [v4]
Axel Boldt-Christmas
aboldtch at openjdk.org
Thu Feb 1 11:02:07 UTC 2024
On Thu, 1 Feb 2024 10:16:14 GMT, Richard Reingruber <rrich at openjdk.org> wrote:
>> Axel Boldt-Christmas has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains five additional commits since the last revision:
>>
>> - Introduce separate API for enter from a different thread
>> - Merge remote-tracking branch 'upstream_jdk/master' into JDK-8324881
>> - More restrictive API
>> - Add regression test
>> - 8324881: ObjectSynchronizer::inflate(Thread* current...) is invoked for non-current thread
>
> 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`
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/17626#discussion_r1474249824
More information about the hotspot-dev
mailing list