X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=Documentation%2Fatomic_ops.txt;h=c9d1cacb439590a02dbfb1282cbe0d3abe3a9b0d;hb=0a95d11068a459d35607f6af6e2b2d5ce9052cb8;hp=b19fc34efdb17921af43bda0000b13dc82640451;hpb=38dab9ac1c017e96dc98e978111e365134d41d13;p=firefly-linux-kernel-4.4.55.git diff --git a/Documentation/atomic_ops.txt b/Documentation/atomic_ops.txt index b19fc34efdb1..c9d1cacb4395 100644 --- a/Documentation/atomic_ops.txt +++ b/Documentation/atomic_ops.txt @@ -542,6 +542,10 @@ The routines xchg() and cmpxchg() must provide the same exact memory-barrier semantics as the atomic and bit operations returning values. +Note: If someone wants to use xchg(), cmpxchg() and their variants, +linux/atomic.h should be included rather than asm/cmpxchg.h, unless +the code is in arch/* and can take care of itself. + Spinlocks and rwlocks have memory barrier expectations as well. The rule to follow is simple: