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

Neethu Prasad duke at openjdk.org
Fri Jun 7 20:06:16 UTC 2024


On Thu, 6 Jun 2024 21:19:16 GMT, Neethu Prasad <duke at openjdk.org> wrote:

> **Notes**
> 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 tests
> 
> 2. Benchmarking on [c6a.12xlarge](https://aws.amazon.com/ec2/instance-types/c6a/)
> **Prior to this PR:**
> 
> 
> dev-dsk-neethp-jdk-2c-ad54955c % jdk/build/linux-x86_64-server-release/images/jdk/bin/java -Xmx1g -Xms1g -XX:+UseShenandoahGC -Xlog:gc ManyThreadsStacks.java 2>&1 | grep "marking roots"
> [0.697s][info][gc] GC(0) Concurrent marking roots 82.772ms
> [0.800s][info][gc] GC(1) Concurrent marking roots 82.675ms
> [0.883s][info][gc] GC(2) Concurrent marking roots 67.893ms
> [0.976s][info][gc] GC(3) Concurrent marking roots 76.811ms
> [1.064s][info][gc] GC(4) Concurrent marking roots 73.170ms
> [1.276s][info][gc] GC(5) Concurrent marking roots 68.098ms
> [1.386s][info][gc] GC(6) Concurrent marking roots 78.548ms
> [1.496s][info][gc] GC(7) Concurrent marking roots 77.666ms
> [1.601s][info][gc] GC(8) Concurrent marking roots 69.263ms
> [1.714s][info][gc] GC(9) Concurrent marking roots 70.956ms
> [1.838s][info][gc] GC(10) Concurrent marking roots 75.879ms
> [1.956s][info][gc] GC(11) Concurrent marking roots 71.753ms
> [2.085s][info][gc] GC(12) Concurrent marking roots 78.325ms
> [2.214s][info][gc] GC(13) Concurrent marking roots 72.238ms
> [2.337s][info][gc] GC(14) Concurrent marking roots 75.127ms
> 
> 
> **After:**
> 
> 
> dev-dsk-neethp-jdk-2c-ad54955c % jdk/build/linux-x86_64-server-release/images/jdk/bin/java -Xmx1g -Xms1g -XX:+UseShenandoahGC -Xlog:gc ManyThreadsStacks.java 2>&1 | grep "marking roots"  
> [0.617s][info][gc] GC(0) Concurrent marking roots 5.553ms
> [0.643s][info][gc] GC(1) Concurrent marking roots 3.148ms
> [0.666s][info][gc] GC(2) Concurrent marking roots 3.219ms
> [0.687s][info][gc] GC(3) Concurrent marking roots 2.796ms
> [0.708s][info][gc] GC(4) Concurrent marking roots 2.892ms
> [0.946s][info][gc] GC(5) Concurrent marking roots 3.393ms
> [1.023s][info][gc] GC(6) Concurrent marking roots 2.710ms
> [1.095s][info][gc] GC(7) Concurrent marking roots 2.466ms
> [1.173s][info][gc] GC(8) Concurrent marking roots 2.734ms
> [1.247s][info][gc] GC(9) Concurrent marking roots 2.706ms
> [1.325s][info][gc] GC(10) Concurrent marking roots 2.451ms
> [1.397s][info][gc] GC(11) Concurrent marking roots 2.381ms
> [1.477s][info][gc] GC(12) Concurrent marking roots 2.411ms
> [1.555s][info][gc] GC(13) Concurrent marking roots 2.222ms
> [1.628s][info][gc] GC(14) Concurrent marking roots 2.599ms

This pull request has now been integrated.

Changeset: 18e7d7b5
Author:    Neethu Prasad <neethp at amazon.com>
Committer: Paul Hohensee <phh at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/18e7d7b5e710b24e49b995777906a197e35795e6
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, ysr, wkemper

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

PR: https://git.openjdk.org/jdk/pull/19587


More information about the hotspot-gc-dev mailing list