Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Documentation: Memory barrier semantics of atomic_xchg()

Add atomic_xchg() to documentation for atomic operations and
memory barriers.

Signed-off-by: Richard Braun <rbraun@sceen.net>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>

authored by

Richard Braun and committed by
Paul E. McKenney
7e8b1e78 52494535

+3
+2
Documentation/atomic_ops.txt
··· 253 253 the given new value. It returns the old value that the atomic variable v had 254 254 just before the operation. 255 255 256 + atomic_xchg requires explicit memory barriers around the operation. 257 + 256 258 int atomic_cmpxchg(atomic_t *v, int old, int new); 257 259 258 260 This performs an atomic compare exchange operation on the atomic value v,
+1
Documentation/memory-barriers.txt
··· 1685 1685 1686 1686 xchg(); 1687 1687 cmpxchg(); 1688 + atomic_xchg(); 1688 1689 atomic_cmpxchg(); 1689 1690 atomic_inc_return(); 1690 1691 atomic_dec_return();