RFR: 8331405: Shenandoah: Optimize ShenandoahLock with TTAS

Y. Srinivas Ramakrishna ysr at openjdk.org
Tue Apr 30 19:59:02 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`

Change looks good; reviewed.

Can you share any comparative performance data, may be?

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

Marked as reviewed by ysr (Reviewer).

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


More information about the shenandoah-dev mailing list