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

Neethu Prasad duke at openjdk.org
Fri Jun 7 03:03:15 UTC 2024


**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.

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

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

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

Changes: https://git.openjdk.org/jdk/pull/19587/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=19587&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8333716
  Stats: 8 lines in 1 file changed: 6 ins; 0 del; 2 mod
  Patch: https://git.openjdk.org/jdk/pull/19587.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/19587/head:pull/19587

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


More information about the hotspot-gc-dev mailing list