[jdk17u-dev] RFR: 8325587: Shenandoah: ShenandoahLock should allow blocking in VM
Aleksey Shipilev
shade at openjdk.org
Mon Aug 19 15:23:08 UTC 2024
On Tue, 13 Aug 2024 16:54:05 GMT, Xiaolong Peng <xpeng at openjdk.org> wrote:
> Hi,
> This PR is a Backport of [JDK-8325587](https://bugs.openjdk.org/browse/JDK-8325587): Shenandoah: ShenandoahLock should allow blocking in VM, the original commit was authored by Aleksey Shipilev on 21 Feb 2024 and was reviewed by Robbin Ehn and Roman Kennke, and already backported to jdk21.
> It is not a clean backport for JDK17 due to code style change(NULL -> nullptr) and thread header file and API changes.
> This is the first backport of a series of improvements for ShenandoahLock to improve contention issue which we I have seem in our customer's production load running with JDK17, here are the series of improvements I'm going to backport to JDK17:
>
> | Bug | Title |
> | ----------- | ---------------------------------------------- |
> | [JDK-8325587](https://bugs.openjdk.org/browse/JDK-8325587) | ShenandoahLock should allow blocking in VM |
> | [JDK-8331405](https://bugs.openjdk.org/browse/JDK-8331405) | Optimize ShenandoahLock with TTAS |
> | [JDK-8331411](https://bugs.openjdk.org/browse/JDK-8331411) | Reconsider spinning duration in ShenandoahLock |
> | [JDK-8335904](https://bugs.openjdk.org/browse/JDK-8335904) | Fix invalid comment in ShenandoahLock |
>
>
> Best,
> Xiaolong.
>
>
> Additional tests:
> - [x] hotspot_gc_shenandoah
> - [x] Linux x86_64 server fastdebug, all passes with -XX:+UseShenandoahGC
Looks fine, with minor nit.
src/hotspot/share/gc/shenandoah/shenandoahLock.cpp line 47:
> 45: Thread* thread = Thread::current();
> 46: if (allow_block_for_safepoint && thread->is_Java_thread()) {
> 47: contended_lock_internal<ThreadBlockInVM>(static_cast<JavaThread*>(thread));
The preferred style in older JDKs is `thread->as_Java_thread()`.
-------------
Marked as reviewed by shade (Reviewer).
PR Review: https://git.openjdk.org/jdk17u-dev/pull/2797#pullrequestreview-2245837398
PR Review Comment: https://git.openjdk.org/jdk17u-dev/pull/2797#discussion_r1721963335
More information about the jdk-updates-dev
mailing list