Skip to content

Commit 5da7667

Browse files
author
Martin Schwidefsky
committed
s390/barrier: remove unnecessary serialization in atomics and bitops
The principles of operation states reads are in order, writes are in order, writes can be reordered after reads, but no reads can be reordered after writes. The atomic and bitops variantes for z196 use the interlocked-access facility instructions with a memory barrier before and after the instruction. Because of the memory ordering the first barrier is unnecessary and can be removed. Acked-by: Heiko Carstens <[email protected]> Signed-off-by: Martin Schwidefsky <[email protected]>
1 parent b5a6b71 commit 5da7667

File tree

2 files changed

+0
-3
lines changed

2 files changed

+0
-3
lines changed

arch/s390/include/asm/atomic.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
\
3737
typecheck(atomic_t *, ptr); \
3838
asm volatile( \
39-
__barrier \
4039
op_string " %0,%2,%1\n" \
4140
__barrier \
4241
: "=d" (old_val), "+Q" ((ptr)->counter) \
@@ -180,7 +179,6 @@ static inline int __atomic_add_unless(atomic_t *v, int a, int u)
180179
\
181180
typecheck(atomic64_t *, ptr); \
182181
asm volatile( \
183-
__barrier \
184182
op_string " %0,%2,%1\n" \
185183
__barrier \
186184
: "=d" (old_val), "+Q" ((ptr)->counter) \

arch/s390/include/asm/bitops.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@
6464
\
6565
typecheck(unsigned long *, (__addr)); \
6666
asm volatile( \
67-
__barrier \
6867
__op_string " %0,%2,%1\n" \
6968
__barrier \
7069
: "=d" (__old), "+Q" (*(__addr)) \

0 commit comments

Comments
 (0)