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

Neethu Prasad duke at openjdk.org
Wed Jun 12 13:46:13 UTC 2024


On Tue, 11 Jun 2024 17:42:36 GMT, Neethu Prasad <duke at openjdk.org> wrote:

> **Notes**
> JDK 21 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. tier 1, tier 2, 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 % jdk21u-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.679s][info][gc] GC(0) Concurrent marking roots 72.911ms
> [0.787s][info][gc] GC(1) Concurrent marking roots 86.382ms
> [0.884s][info][gc] GC(2) Concurrent marking roots 81.214ms
> [0.980s][info][gc] GC(3) Concurrent marking roots 80.542ms
> [1.074s][info][gc] GC(4) Concurrent marking roots 78.546ms
> [1.297s][info][gc] GC(5) Concurrent marking roots 86.590ms
> [1.435s][info][gc] GC(6) Concurrent marking roots 85.026ms
> [1.575s][info][gc] GC(7) Concurrent marking roots 85.214ms
> [1.721s][info][gc] GC(8) Concurrent marking roots 89.698ms
> [1.862s][info][gc] GC(9) Concurrent marking roots 80.378ms
> [1.996s][info][gc] GC(10) Concurrent marking roots 75.904ms
> [2.129s][info][gc] GC(11) Concurrent marking roots 78.489ms
> [2.253s][info][gc] GC(12) Concurrent marking roots 73.650ms
> [2.393s][info][gc] GC(13) Concurrent marking roots 86.164ms
> [2.525s][info][gc] GC(14) Concurrent marking roots 79.495ms
> [2.656s][info][gc] GC(15) Concurrent marking roots 79.613ms
> [2.792s][info][gc] GC(16) Concurrent marking roots 82.616ms
> [2.932s][info][gc] GC(17) Concurrent marking roots 78.196ms
> [3.058s][info][gc] GC(18) Concurrent marking roots 75.565ms
> [3.196s][info][gc] GC(19) Concurrent marking roots 84.462ms
> [3.336s][info][gc] GC(20) Concurrent marking roots 81.337ms
> 
> 
> **After:**
> 
> 
> dev-dsk-neethp-jdk-2c-ad54955c % jdk21u-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.613s][info][gc] GC(0) Concurrent marking roots 4.845ms
> [0.641s][info][gc] GC(1) Concurrent marking roots 3.911ms
> [0.665s][info][gc] GC(2) Concurrent marking roots 3.893ms
> [0.687s][info][gc] GC(3) Concurrent marking roots 3.520ms
> [0.708s][info][gc] GC(4) Concurrent marking roots 3.483ms
> [0.944s][info][gc] GC(5) Concurrent marking roots 3.904ms
> [1.021s][info][gc] GC(6) Concurrent marking roots ...

This pull request has now been integrated.

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

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

Reviewed-by: shade
Backport-of: 18e7d7b5e710b24e49b995777906a197e35795e6

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

PR: https://git.openjdk.org/jdk21u-dev/pull/695


More information about the jdk-updates-dev mailing list