]> www.infradead.org Git - users/jedix/linux-maple.git/commit
s390/cmpxchg: Convert one and two byte case inline assemblies to C
authorHeiko Carstens <hca@linux.ibm.com>
Wed, 6 Nov 2024 10:03:06 +0000 (11:03 +0100)
committerHeiko Carstens <hca@linux.ibm.com>
Tue, 12 Nov 2024 13:01:28 +0000 (14:01 +0100)
commitc8603d692857a43e6f8b7b5eccab1d9aec48bd12
tree24d87c6b7096962c9e2464e984aaf5cf0172ec9e
parent01bfb451a3e9b7005d626964588d89b699749147
s390/cmpxchg: Convert one and two byte case inline assemblies to C

Rewrite __cmpxchg() in order to get rid of the large inline
assemblies. Convert the one and two byte inline assemblies to
C functions.

The generated code of the new implementation is nearly as good or bad as
the old variant, but easier to read.

Note that the new variants are quite close to the generic cmpxchg_emu_u8()
implementation, however a conversion to the generic variant will not follow
since with mm/vmstat.c there is heavy user of one byte cmpxchg(). A not
inlined variant would have a negative performance impact.

Also note that the calls within __arch_cmpxchg() come with rather pointless
"& 0xff..." operations. They exist only to avoid false positive sparse
warnings like "warning: cast truncates bits from constant value ...".

Reviewed-by: Juergen Christ <jchrist@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
arch/s390/include/asm/cmpxchg.h