RFR: 8314225: SIGSEGV in JavaThread::is_lock_owned
Kevin Walls
kevinw at openjdk.org
Thu Jan 25 21:39:00 UTC 2024
On Thu, 25 Jan 2024 14:20:08 GMT, Kevin Walls <kevinw at openjdk.org> wrote:
>> src/hotspot/share/runtime/javaThread.cpp line 1043:
>>
>>> 1041: chunks = _monitor_chunks; // will be null, as deopt frees when finished
>>> 1042: } else {
>>> 1043: ReadMonitorChunksHandshake rmch;
>>
>> How expensive is the Handshake versus the direct read? Is it worth optimistically reading using `monitor_chunks()` and only attempt the handshake if it returns non-null?
>>
>> Or is there an API to probe if a thread is in a deopt that we can wrap around the handshake?
>>
>> If the handshake is cheap enough, then this isn't worth looking at further.
>
> Actually yes I was thinking about checking the value for non-null first, I will try that out. No handshake has to be faster... 8-)
Updated - if _monitor_chunks is null, avoid the handshake, and the check if we are at a safepoint.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/17566#discussion_r1466983462
More information about the hotspot-dev
mailing list