[lttng-dev] [PATCH 2/7] Use gcc __atomic builtis for <urcu/uatomic.h> implementation

Duncan Sands baldrick at free.fr
Mon Mar 20 15:38:59 EDT 2023

Hi Mathieu,

> While OK for the general case, I would recommend that we immediately implement 
> something more efficient on x86 32/64 which takes into account that 
> __ATOMIC_ACQ_REL atomic operations are implemented with LOCK prefixed atomic 
> ops, which imply the barrier already, leaving the before/after_uatomic_*() as 
> no-ops.

maybe first check whether the GCC optimizers merge them.  I believe some 
optimizations of atomic primitives are allowed and implemented, but I couldn't 
say which ones.

Best wishes, Duncan.

More information about the lttng-dev mailing list