RFR: 8331405: Shenandoah: Optimize ShenandoahLock with TTAS

Zhengyu Gu zgu at openjdk.org
Tue Apr 30 13:46:04 UTC 2024


On Tue, 30 Apr 2024 10:29:53 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:

> 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`

LGTM

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

Marked as reviewed by zgu (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/19018#pullrequestreview-2031412587


More information about the shenandoah-dev mailing list