RFR: 8232782: Shenandoah: streamline post-LRB CAS barrier (aarch64)

Andrew Haley aph at redhat.com
Sat Jun 27 08:02:39 UTC 2020

On 26/06/2020 21:21, Nilsen, Kelvin wrote:
> Is there consensus that we should use CAS instruction instead of ldxr/stxr?
> Presumably, there are some platforms where ldxr/stxr performs better than CAS, or at least there is the potential that such would exist.
> Perhaps the JIT and run-time should adjust their behavior depending on the host platform.

That's exactly what it does.

> Perhaps the whole issue of which synchronization primitives to use should be addressed in a different ticket.
> I am willing to rework this patch.  Just need some clear guidance as to which direction to move it.

Simple: don't use ldxr/stxr, call MacroAssembler::cmpxchg() . It will do
the right thing on whatever platform it runs on.

Andrew Haley  (he/him)
Java Platform Lead Engineer
Red Hat UK Ltd. <https://www.redhat.com>
EAC8 43EB D3EF DB98 CC77 2FAD A5CD 6035 332F A671

More information about the hotspot-gc-dev mailing list