RFR: 8320318: ObjectMonitor Responsible thread

David Holmes dholmes at openjdk.org
Wed Sep 11 06:57:10 UTC 2024


On Wed, 11 Sep 2024 06:16:33 GMT, Axel Boldt-Christmas <aboldtch at openjdk.org> wrote:

>> src/hotspot/cpu/x86/c2_MacroAssembler_x86.cpp line 476:
>> 
>>> 474:   // Release lock.
>>> 475:   movptr(Address(tmpReg, OM_OFFSET_NO_MONITOR_VALUE_TAG(owner)), NULL_WORD);
>>> 476:   membar(StoreLoad);
>> 
>> Why a standalone `storeload` here? This does not define a fence, nor release semantics - as per the definitions in orderAccess.hpp
>
> On x86 `membar(LoadStore | StoreStore /* release */)` would be a nop. Not sure if adding it before nulling the pointer would make things clearer.
> 
> `membar(StoreLoad);` is all that we need between clearing the owner and checking the queues / successor.

Okay so again a "fence" reduces to a "StoreLoad" in practice for x86, but it would be nice if something - even a comment - stated "full fence" so the semantics are clear.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/19454#discussion_r1753281373


More information about the hotspot-dev mailing list