RFR: 8252857: AArch64: Shenandoah C1 CAS is not sequentially consistent

Andrew Haley aph at redhat.com
Mon Sep 21 10:23:47 UTC 2020


On 21/09/2020 10:11, Nick Gasson wrote:
> C1 atomic operations are supposed to be sequentially consistent by
> default but the variant in the Shenandoah C1 barrier set assembler only
> provides a half-barrier when the CAS succeeds. Added a trailing full
> barrier and load-acquire to exactly match the non-Shenandoah C1 CAS
> implementation. This prevents any memory accesses following the CAS
> operation being observed before it.

We only need the trailing membar if is_c1_or_interpreter_only(). Otherwise
all volatile loads in C1 are preceded by a leading membar() so we don't
need a trailing one as well.

>> 462 // By default, this operation has relaxed memory ordering

No, it has whatever memory ordering you tell it. Plus, if you pass
both acquire and release, sequential consistency.

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



More information about the shenandoah-dev mailing list