RFR: 8320318: ObjectMonitor Responsible thread
Fei Yang
fyang at openjdk.org
Wed Sep 11 07:51:06 UTC 2024
On Wed, 29 May 2024 12:58:02 GMT, Fredrik Bredberg <fbredberg 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.
Performed hs-tier1 - hs-tier3 tests on linux-riscv64 platform. Two minor comments for the riscv part.
src/hotspot/cpu/riscv/c2_MacroAssembler_riscv.cpp line 237:
> 235: ld(t0, Address(tmp, ObjectMonitor::EntryList_offset()));
> 236: ld(disp_hdr, Address(tmp, ObjectMonitor::cxq_offset()));
> 237: orr(t0, t0, disp_hdr);
It looks better to me if we use `tmp1Reg` here instead of its alias `disp_hdr` like you do for aarch64. I mean:
ld(tmp1Reg, Address(tmp, ObjectMonitor::cxq_offset()));
orr(t0, t0, tmp1Reg);
src/hotspot/cpu/riscv/c2_MacroAssembler_riscv.cpp line 568:
> 566: ld(tmp3_t, Address(tmp1_monitor, ObjectMonitor::cxq_offset()));
> 567: orr(t0, t0, tmp3_t);
> 568: beqz(t0, unlocked); // If so we are done.
You might want to remove the preceding definition of label `release` as it is not used after this change.
-------------
Changes requested by fyang (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/19454#pullrequestreview-2292742845
PR Review Comment: https://git.openjdk.org/jdk/pull/19454#discussion_r1752121330
PR Review Comment: https://git.openjdk.org/jdk/pull/19454#discussion_r1752123657
More information about the hotspot-dev
mailing list