arch,xtensa: Convert smp_mb__*()
authorPeter Zijlstra <peterz@infradead.org>
Thu, 13 Mar 2014 18:00:35 +0000 (19:00 +0100)
committerIngo Molnar <mingo@kernel.org>
Fri, 18 Apr 2014 12:20:47 +0000 (14:20 +0200)
Xtensa SMP has compare-and-swap which is fully serializing, therefore
its exising smp_mb__{before,after}_clear_bit() appear unduly heavy.

Implement the new barriers as barrier().

Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Link: http://lkml.kernel.org/n/tip-e9rqjxr1m1ejsob9p433kmji@git.kernel.org
Cc: Chris Zankel <chris@zankel.net>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
Cc: Max Filippov <jcmvbkbc@gmail.com>
Cc: linux-kernel@vger.kernel.org
Cc: linux-xtensa@linux-xtensa.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
arch/xtensa/include/asm/atomic.h
arch/xtensa/include/asm/barrier.h
arch/xtensa/include/asm/bitops.h

index e7fb447bce8ead5188066171ce5a8cf5dd92d3cf..e5103b47a8cefaf98a6e97d5f6bbd987eecb8c91 100644 (file)
@@ -19,6 +19,7 @@
 #ifdef __KERNEL__
 #include <asm/processor.h>
 #include <asm/cmpxchg.h>
+#include <asm/barrier.h>
 
 #define ATOMIC_INIT(i) { (i) }
 
@@ -387,12 +388,6 @@ static inline void atomic_set_mask(unsigned int mask, atomic_t *v)
 #endif
 }
 
-/* Atomic operations are already serializing */
-#define smp_mb__before_atomic_dec()    barrier()
-#define smp_mb__after_atomic_dec()     barrier()
-#define smp_mb__before_atomic_inc()    barrier()
-#define smp_mb__after_atomic_inc()     barrier()
-
 #endif /* __KERNEL__ */
 
 #endif /* _XTENSA_ATOMIC_H */
index 0a24b04d6b217b6e5a355005edeb65c7a4f8985d..5b88774c75abaee187cc5b1f3915858b3452d3b4 100644 (file)
@@ -13,6 +13,9 @@
 #define rmb() barrier()
 #define wmb() mb()
 
+#define smp_mb__before_atomic()                barrier()
+#define smp_mb__after_atomic()         barrier()
+
 #include <asm-generic/barrier.h>
 
 #endif /* _XTENSA_SYSTEM_H */
index 7b6873ae84c295740d8183b52610ba0ce91aad91..3f44fa2a53e9fcde4266717bd245d15c0b530559 100644 (file)
@@ -21,9 +21,7 @@
 
 #include <asm/processor.h>
 #include <asm/byteorder.h>
-
-#define smp_mb__before_clear_bit()     smp_mb()
-#define smp_mb__after_clear_bit()      smp_mb()
+#include <asm/barrier.h>
 
 #include <asm-generic/bitops/non-atomic.h>