[PATCH 1/4] s390/percpu: Use asm_inline for arch_this_cpu_add()
From: Heiko Carstens
Date: Mon Oct 12 2026 - 07:43:35 EST
When converting to preemptible percpu operations the arch_this_cpu_add()
inline assemblies were not converted to use asm_inline instead of a plain
asm statement.
With all the macro usage the inline assemblies grow significantly, and
the compiler may decide to not inline even small functions. This can be
observed with gcc16 and a defconfig build where many calls to
__srcu_read_lock_fast() are not inlined anymore, even though it is
basically only a this_cpu_inc().
Use asm_inline to address this.
Fixes: 18ec6c5d7ec6 ("s390/percpu: Use new percpu code section for arch_this_cpu_add()")
Signed-off-by: Heiko Carstens <hca@xxxxxxxxxxxxx>
---
arch/s390/include/asm/percpu.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/s390/include/asm/percpu.h b/arch/s390/include/asm/percpu.h
index c3995bd8d1de..dfab41b43b8b 100644
--- a/arch/s390/include/asm/percpu.h
+++ b/arch/s390/include/asm/percpu.h
@@ -193,7 +193,7 @@ do { \
ptr__ = PERCPU_PTR(&(pcp)); \
if (__builtin_constant_p(val__) && \
((szcast)val__ > -129) && ((szcast)val__ < 128)) { \
- asm volatile( \
+ asm_inline volatile( \
__PCPU_BEGIN("%[lcreg]","%[lcoff]","%[ptr__]", \
"%[pair__]","%N[pair__]") \
op2 " 0(%N[pair__]),%[val__]\n" \
@@ -206,7 +206,7 @@ do { \
"m" (((struct lowcore *)0)->percpu_offset) \
: "cc"); \
} else { \
- asm volatile( \
+ asm_inline volatile( \
__PCPU_BEGIN("%[lcreg]","%[lcoff]","%[ptr__]", \
"%[pair__]","%N[pair__]") \
op1 " %[old__],%[val__],0(%N[pair__])\n" \
--
2.53.0