]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: atomic/arm64: detect and use builtins for the double-word CAS
authorWilly Tarreau <w@1wt.eu>
Tue, 6 Apr 2021 07:21:33 +0000 (09:21 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 7 Apr 2021 16:18:37 +0000 (18:18 +0200)
commit6756d95a8ec2ae15d8070ed4e0e1d66a778c6d7a
treeec3a2ad3ccca0ea266ca81685309f82d22aaa502
parent184b21259b8801354a6aa60f954d5153812036d0
MINOR: atomic/arm64: detect and use builtins for the double-word CAS

Gcc 10.2 implements outline atomics on aarch64. The replace all inline
atomic ops with a function call that checks if the machine supports LSE
atomics. This comes with a small cost but allows modern machines to scale
much better than with the old LL/SC ones even when built for full 8.0
compatibility.

This patch enables the use of the __atomic_compare_exchange() builtin
for the double-word CAS when detected as available instead of using the
hand-written LL/SC version. The extra cost is negligible because we do
very few DWCAS operations (essentially FD migrations and shared pools)
so the cost is low but under high contention it can still be beneficial.
As expected no performance difference was measured in either direction
on 4-core machines with this change.

This could be backported to 2.3 if it was shown that FD migrations were
representing a significant source of contention, but for now it does
not appear to be needed.
include/haproxy/atomic.h