arch,s390: 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:42 +0000 (14:20 +0200)
As per the existing implementation; implement the new one using
smp_mb().

AFAICT the s390 compare-and-swap does imply a barrier, however there
are some immediate ops that seem to be singly-copy atomic and do not
imply a barrier. One such is the "ni" op (which would be
and-immediate) which is used for the constant clear_bit
implementation. Therefore s390 needs full barriers for the
{before,after} atomic ops.

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-kme5dz5hcobpnufnnkh1ech2@git.kernel.org
Cc: Chen Gang <gang.chen@asianux.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: linux390@de.ibm.com
Cc: linux-kernel@vger.kernel.org
Cc: linux-s390@vger.kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
arch/s390/include/asm/atomic.h
arch/s390/include/asm/barrier.h

index 1d4706114a454ae848e107c6f35a2350691948db..fa934fe080c17bf30e9ff3e0829186b65b7dfc7b 100644 (file)
@@ -412,9 +412,4 @@ static inline long long atomic64_dec_if_positive(atomic64_t *v)
 #define atomic64_dec_and_test(_v)      (atomic64_sub_return(1, _v) == 0)
 #define atomic64_inc_not_zero(v)       atomic64_add_unless((v), 1, 0)
 
-#define smp_mb__before_atomic_dec()    smp_mb()
-#define smp_mb__after_atomic_dec()     smp_mb()
-#define smp_mb__before_atomic_inc()    smp_mb()
-#define smp_mb__after_atomic_inc()     smp_mb()
-
 #endif /* __ARCH_S390_ATOMIC__  */
index 578680f6207acb62ccc8f52c321c349f510f73a6..19ff956b752baf751380e1ecf553b8983cdad56d 100644 (file)
@@ -27,8 +27,9 @@
 #define smp_rmb()                      rmb()
 #define smp_wmb()                      wmb()
 #define smp_read_barrier_depends()     read_barrier_depends()
-#define smp_mb__before_clear_bit()     smp_mb()
-#define smp_mb__after_clear_bit()      smp_mb()
+
+#define smp_mb__before_atomic()                smp_mb()
+#define smp_mb__after_atomic()         smp_mb()
 
 #define set_mb(var, value)             do { var = value; mb(); } while (0)