RFR: 8331405: Shenandoah: Optimize ShenandoahLock with TTAS

Aleksey Shipilev shade at openjdk.org
Tue Apr 30 11:36:13 UTC 2024


JDK-8325587 made the contended lock acquisition as the CAS loop with backoffs. Unfortunately, for `SpinPause` path, we always do the CAS and then spin. This is not efficient, as CAS likely requests memory for ownership, which exacerbates the contention and makes the spin loop run longer before blocking.

We should really use TTAS pattern there, like `Thread::SpinAcquire` does it.

Additional testing:
 - [x] Linux AArch64 server fastdebug, `hotspot_gc_shenandoah`
 - [ ] Linux AArch64 server fastdebug, `all` with `-XX:+UseShenandoahGC`

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

Commit messages:
 - Fix

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

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


More information about the hotspot-gc-dev mailing list