[jdk17u-dev] Integrated: 8333716: Shenandoah: Check for disarmed method before taking the nmethod lock

Neethu Prasad duke at openjdk.org
Thu Jun 13 22:05:22 UTC 2024


On Tue, 11 Jun 2024 19:10:11 GMT, Neethu Prasad <duke at openjdk.org> wrote:

> **Notes**
> JDK 17 backport for [JDK-8333716](https://bugs.openjdk.org/browse/JDK-8333716).
> 
> We are spending significant time on acquiring the per-nmethod as all the
> threads are in same nmethod.
> Adding double-check lock by calling is_armed before lock acquisition.
> 
> **Verification**
> 1. hotspot_gc and  hotspot_gc_shenandoah tests
> 
> 2. Benchmarking on [c6a.12xlarge](https://aws.amazon.com/ec2/instance-types/c6a/)
> **Prior to this PR:**
> 
> 
> dev-dsk-neethp-jdk-2c-ad54955c % jdk17u-dev/build/linux-x86_64-server-release/images/jdk/bin/java -Xmx1g -Xms1g -XX:+UseShenandoahGC -Xlog:gc ManyThreadsStacks.java 2>&1 | grep "marking roots"
> [0.662s][info][gc] GC(0) Concurrent marking roots 86.390ms
> [0.786s][info][gc] GC(1) Concurrent marking roots 100.924ms
> [0.892s][info][gc] GC(2) Concurrent marking roots 86.194ms
> [1.005s][info][gc] GC(3) Concurrent marking roots 91.148ms
> [1.127s][info][gc] GC(4) Concurrent marking roots 105.993ms
> [1.338s][info][gc] GC(5) Concurrent marking roots 105.688ms
> [1.524s][info][gc] GC(6) Concurrent marking roots 100.296ms
> [1.700s][info][gc] GC(7) Concurrent marking roots 100.837ms
> [1.867s][info][gc] GC(8) Concurrent marking roots 86.750ms
> [2.019s][info][gc] GC(9) Concurrent marking roots 90.834ms
> [2.184s][info][gc] GC(10) Concurrent marking roots 95.014ms
> [2.353s][info][gc] GC(11) Concurrent marking roots 96.484ms
> [2.522s][info][gc] GC(12) Concurrent marking roots 99.743ms
> [2.679s][info][gc] GC(13) Concurrent marking roots 91.842ms
> [2.847s][info][gc] GC(14) Concurrent marking roots 101.321ms
> [3.005s][info][gc] GC(15) Concurrent marking roots 89.214ms
> [3.159s][info][gc] GC(16) Concurrent marking roots 90.958ms
> [3.324s][info][gc] GC(17) Concurrent marking roots 92.622ms
> 
> 
> **After:**
> 
> 
> dev-dsk-neethp-jdk-2c-ad54955c % jdk17u-dev/build/linux-x86_64-server-release/images/jdk/bin/java -Xmx1g -Xms1g -XX:+UseShenandoahGC -Xlog:gc ManyThreadsStacks.java 2>&1 | grep "marking roots"  
> [0.904s][info][gc] GC(0) Concurrent marking roots 6.698ms
> [0.934s][info][gc] GC(1) Concurrent marking roots 6.004ms
> [0.961s][info][gc] GC(2) Concurrent marking roots 5.089ms
> [0.986s][info][gc] GC(3) Concurrent marking roots 5.134ms
> [1.020s][info][gc] GC(4) Concurrent marking roots 4.797ms
> [1.252s][info][gc] GC(5) Concurrent marking roots 5.856ms
> [1.335s][info][gc] GC(6) Concurrent marking roots 4.467ms
> [1.417s][info][gc] GC(7) Concurrent marking roots 4.963ms
> [1.498s][info][gc] GC(8) Concurrent marking roots 5.005ms
> [1.579s][info][gc] GC(9) Concurrent marking roots 5.354ms
> [1.660...

This pull request has now been integrated.

Changeset: b46208d4
Author:    Neethu Prasad <neethp at amazon.com>
Committer: Martin Doerr <mdoerr at openjdk.org>
URL:       https://git.openjdk.org/jdk17u-dev/commit/b46208d466fd5cf003bfc6281f3c925ca5258135
Stats:     8 lines in 1 file changed: 6 ins; 0 del; 2 mod

8333716: Shenandoah: Check for disarmed method before taking the nmethod lock

Backport-of: 18e7d7b5e710b24e49b995777906a197e35795e6

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

PR: https://git.openjdk.org/jdk17u-dev/pull/2568


More information about the jdk-updates-dev mailing list