RFR: 8307236: Rendezvous GC threads under STS for monitor deflation
Aleksey Shipilev
shade at openjdk.org
Thu May 4 08:47:15 UTC 2023
On Thu, 4 May 2023 08:28:03 GMT, Erik Österlund <eosterlund at openjdk.org> wrote:
>> src/hotspot/share/runtime/synchronizer.cpp line 1546:
>>
>>> 1544: // being afraid that the object-monitor is going away.
>>> 1545: VM_RendezvousGCThreads sync_gc;
>>> 1546: VMThread::execute(&sync_gc);
>>
>> Not sure why this block is under `current->is_Java_thread()` block. Shouldn't we rendezvous with GC threads regardless?
>
>> Not sure why this block is under `current->is_Java_thread()` block. Shouldn't we rendezvous with GC threads regardless?
>
> Deflation is done either concurrently by the service thread, or in a safepoint by the VM thread. The current->is_Java_thread() means it's the concurrent case from the service thread. That's when it's needed. Inside of safepoints, the GC threads have already been synchronized.
Okay, I see. Can we then move this block into separate `current->is_service_thread()`-checked block, and `assert(current->is_VM_thread())` on `else` branch? This would make this distinction very clear.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/13773#discussion_r1184722928
More information about the hotspot-runtime-dev
mailing list