]> git.karo-electronics.de Git - karo-tx-linux.git/commit
s390/bitops: remove CONFIG_SMP / simplify non-atomic bitops
authorHeiko Carstens <heiko.carstens@de.ibm.com>
Mon, 16 Sep 2013 14:22:05 +0000 (16:22 +0200)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Tue, 15 Oct 2013 12:45:29 +0000 (14:45 +0200)
commit22bb7033d40b7b241a00d592c0a3937b86a05114
treece676f904429f747ff244b06fa8bc5968528f3fd
parentd381b6f93dc718fc3bd24689230a19d52081587f
s390/bitops: remove CONFIG_SMP / simplify non-atomic bitops

Remove CONFIG_SMP from bitops code. This reduces the C code significantly
but also generates better code for the SMP case.

This means that for !CONFIG_SMP set_bit() and friends now also have
compare and swap semantics (read: more code). However nobody really cares
for !CONFIG_SMP and this is the trade-off to simplify the SMP code which we
do care about.

The non-atomic bitops like __set_bit() now generate also better code
because the old code did not have a __builtin_contant_p() check for the
CONFIG_SMP case and therefore always generated the inline assembly variant.
However the inline assemblies for the non-atomic case now got completely
removed since gcc can produce better code, which accesses less memory
operands.

test_bit() got also a bit simplified since it did have a
__builtin_constant_p() check, however two identical code pathes for each
case (written differently).

In result this mainly reduces the to be maintained code but is not very
relevant for code generation, since there are not many non-atomic bitops
usages that we care about.
(code reduction defconfig kernel image before/after: 560 bytes).

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/bitmap.c