s390/bitops: optimize set_bit() for constant values
authorHeiko Carstens <heiko.carstens@de.ibm.com>
Tue, 17 Sep 2013 07:48:44 +0000 (09:48 +0200)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Thu, 24 Oct 2013 15:16:53 +0000 (17:16 +0200)
commit4ae803253e4649803dc6e972bb5e59fc107cf474
tree62aa7337c3b93b3e548557ac0202d072a598f460
parent370b0b5f7744d62a9ba6c25fd6b0dcba84419443
s390/bitops: optimize set_bit() for constant values

Since zEC12 we have the interlocked-access facility 2 which allows to
use the instructions ni/oi/xi to update a single byte in storage with
compare-and-swap semantics.
So change set_bit(), clear_bit() and change_bit() to generate such code
instead of a compare-and-swap loop (or using the load-and-* instruction
family), if possible.
This reduces the text segment by yet another 8KB (defconfig).

Alternatively the long displacement variants niy/oiy/xiy could have
been used, but the extended displacement field is usually not needed
and therefore would only increase the size of the text segment again.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
arch/s390/include/asm/bitops.h
arch/s390/kernel/head.S