RFR: 8320318: ObjectMonitor Responsible thread
Andrew Haley
aph at openjdk.org
Wed Sep 11 13:45:05 UTC 2024
On Wed, 11 Sep 2024 13:35:37 GMT, Andrew Haley <aph at openjdk.org> wrote:
>> Removed the concept of an ObjectMonitor Responsible thread.
>>
>> The reason to have an ObjectMonitor Responsible thread was to avoid threads getting stranded due to a hole in the successor protocol. This hole was there because adding the necessary memory barrier was considered too expensive some 20 years ago.
>>
>> The ObjectMonitor Responsible thread code adds complexity, and doing timed parks just to avoid getting stranded is not the way forward. More info about the problems with the ObjectMonitor responsible thread can be found in [JDK-8320318](https://bugs.openjdk.org/browse/JDK-8320318).
>>
>> After removing the ObjectMonitor Responsible thread we see increased performance on all supported platforms except Windows. [JDK-8339730](https://bugs.openjdk.org/browse/JDK-8339730) has been created to handle this.
>>
>> Passes tier1-tier7 on supported platforms.
>> x64, AArch64, Riscv64, ppc64le and s390x passes ok on the test/micro/org/openjdk/bench/vm/lang/LockUnlock.java test.
>> Arm32 and Zero doesn't need any changes as far as I can tell.
>
> src/hotspot/cpu/aarch64/c2_MacroAssembler_aarch64.cpp line 217:
>
>> 215: stlr(zr, owner_addr);
>> 216: membar(StoreLoad);
>> 217:
>
> Is there some reason we need a `memory_order_conservative` store here?
> You may not really need a `StoreLoad` here, as long as `ObjectMonitor::owner` is always read with `ldar` or `casal`. `Atomic::cmpxchg()` uses sequentially-consistent ops by default.
> Reason: on AArch64, `stlr;ldar` is sequentially consistent, which is stronger than release|acquire.
Oh, not just sequentially consistent, but also barrier-ordered-before.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/19454#discussion_r1754586693
More information about the hotspot-dev
mailing list