lkml.org 
[lkml]   [2014]   [Mar]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH 29/31] arch,xtensa: Convert smp_mb__*
Xtensa SMP has ll/sc which is fully serializing, therefore its exising
smp_mb__{before,after}_clear_bit() appear unduly heavy.

Implement the new barriers are barrier().

Signed-off-by: Peter Zijlstra <peterz@infradead.org>
---
arch/xtensa/include/asm/atomic.h | 7 +------
arch/xtensa/include/asm/barrier.h | 3 +++
arch/xtensa/include/asm/bitops.h | 4 +---
3 files changed, 5 insertions(+), 9 deletions(-)

--- a/arch/xtensa/include/asm/atomic.h
+++ b/arch/xtensa/include/asm/atomic.h
@@ -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(unsig
#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 */
--- a/arch/xtensa/include/asm/barrier.h
+++ b/arch/xtensa/include/asm/barrier.h
@@ -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 */
--- a/arch/xtensa/include/asm/bitops.h
+++ b/arch/xtensa/include/asm/bitops.h
@@ -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>




\
 
 \ /
  Last update: 2014-03-19 08:41    [W:0.112 / U:26.228 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site