[PATCH] arm64: remove HAVE_CMPXCHG_LOCAL

Heiko Carstens hca at linux.ibm.com
Mon Feb 23 01:19:13 PST 2026


On Tue, Feb 17, 2026 at 09:19:22AM -0800, Christoph Lameter (Ampere) wrote:
> On Mon, 16 Feb 2026, Dev Jain wrote:
> 
> > By coincidence, Yang Shi has been discussing the this_cpu_* overhead
> > at [2].
> 
> 
> Yang Shi is on vacation but we have a patchset that removes
> preempt_enable/disable from this_cpu operations on ARM64.
> 
> The performance of cmpxchg varies by platform in use and with the kernel
> config. The measurements that I did 2 years ago indicated that the cmpxchg
> use with Ampere processors did not cause a regression.
> 
> Note that distro kernels often do not enable PREEMPT_FULL and therefore
> preempt_disable/enable overhead is not incurred in production systems.
> 
> PREEMPT_VOLUNTARY does not use preemption for this_cpu ops.

Note that with commit 7dadeaa6e851 ("sched: Further restrict the preemption
modes") at least PREEMPT_LAZY is enforced, which comes together with
PREEMPT_BUILD and full preempt_disable()/preempt_enable() overhead for
this_cpu_* ops for every "up-to-date" architecture (except x86).

PREEMPT_NONE and PREEMPT_VOLUNTARY are gone for those architectures.



More information about the linux-arm-kernel mailing list