]> git.karo-electronics.de Git - karo-tx-linux.git/commit
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, 17 Oct 2013 07:25:59 +0000 (09:25 +0200)
commit1face36c8b66040186532cec5d5eb447a4738efc
tree5989643c9078abf9d9922dae789cfdd9e4c3d5f1
parent9798ab3d9d9fba6df4c1cec2da757b328e400135
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