Skip to content

Commit 12010aa

Browse files
Matthew Wilcox (Oracle)akpm00
authored andcommitted
s390: implement arch_xor_unlock_is_negative_byte
Inspired by the s390 arch_test_and_clear_bit(), this will surely be more efficient than the generic one defined in filemap.c. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Matthew Wilcox (Oracle) <[email protected]> Cc: Albert Ou <[email protected]> Cc: Alexander Gordeev <[email protected]> Cc: Andreas Dilger <[email protected]> Cc: Christian Borntraeger <[email protected]> Cc: Christophe Leroy <[email protected]> Cc: Geert Uytterhoeven <[email protected]> Cc: Heiko Carstens <[email protected]> Cc: Ivan Kokshaysky <[email protected]> Cc: Matt Turner <[email protected]> Cc: Michael Ellerman <[email protected]> Cc: Nicholas Piggin <[email protected]> Cc: Palmer Dabbelt <[email protected]> Cc: Paul Walmsley <[email protected]> Cc: Richard Henderson <[email protected]> Cc: Sven Schnelle <[email protected]> Cc: "Theodore Ts'o" <[email protected]> Cc: Thomas Bogendoerfer <[email protected]> Cc: Vasily Gorbik <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent 2a66728 commit 12010aa

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

arch/s390/include/asm/bitops.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,16 @@ static inline void arch___clear_bit_unlock(unsigned long nr,
201201
arch___clear_bit(nr, ptr);
202202
}
203203

204+
static inline bool arch_xor_unlock_is_negative_byte(unsigned long mask,
205+
volatile unsigned long *ptr)
206+
{
207+
unsigned long old;
208+
209+
old = __atomic64_xor_barrier(mask, (long *)ptr);
210+
return old & BIT(7);
211+
}
212+
#define arch_xor_unlock_is_negative_byte arch_xor_unlock_is_negative_byte
213+
204214
#include <asm-generic/bitops/instrumented-atomic.h>
205215
#include <asm-generic/bitops/instrumented-non-atomic.h>
206216
#include <asm-generic/bitops/instrumented-lock.h>

0 commit comments

Comments
 (0)