[PATCH v4 21/21] arm64: percpu: Remove _pcp_protect*() wrappers
Vladimir Murzin
vladimir.murzin at arm.com
Tue Sep 15 07:21:01 PDT 2026
On 9/8/26 16:17, Mark Rutland wrote:
> Now that all this_cpu_*() operations are preemptible, there are no users
> of _pcp_protect() or _pcp_protect_return().
>
> Remove them both, along with the associated comment regarding
> preemption.
>
> Signed-off-by: Mark Rutland <mark.rutland at arm.com>
> Tested-by: Muhammad Usama Anjum <usama.anjum at arm.com>
> Cc: Ada Couprie Diaz <ada.coupriediaz at arm.com>
> Cc: Ard Biesheuvel <ardb at kernel.org>
> Cc: Catalin Marinas <catalin.marinas at arm.com>
> Cc: James Morse <james.morse at arm.com>
> Cc: Jinjie Ruan <ruanjinjie at huawei.com>
> Cc: Marc Zyngier <maz at kernel.org>
> Cc: Peter Zijlstra <peterz at infradead.org>
> Cc: Vladimir Murzin <vladimir.murzin at arm.com>
> Cc: Will Deacon <will at kernel.org>
> Cc: Yang Shi <yang at os.amperecomputing.com>
> ---
> arch/arm64/include/asm/percpu.h | 27 ---------------------------
> 1 file changed, 27 deletions(-)
>
> diff --git a/arch/arm64/include/asm/percpu.h b/arch/arm64/include/asm/percpu.h
> index 5cd98e20e825d..6ec6e212932d3 100644
> --- a/arch/arm64/include/asm/percpu.h
> +++ b/arch/arm64/include/asm/percpu.h
> @@ -368,33 +368,6 @@ PERCPU_CMPXCHG_OP(x, , 64)
> #undef PERCPU_XCHG_OP
> #undef PERCPU_CMPXCHG_OP
>
> -/*
> - * It would be nice to avoid the conditional call into the scheduler when
> - * re-enabling preemption for preemptible kernels, but doing that in a way
> - * which builds inside a module would mean messing directly with the preempt
> - * count. If you do this, peterz and tglx will hunt you down.
> - *
> - * Not to mention it'll break the actual preemption model for missing a
> - * preemption point when TIF_NEED_RESCHED gets set while preemption is
> - * disabled.
> - */
> -
> -#define _pcp_protect(op, pcp, ...) \
> -({ \
> - preempt_disable_notrace(); \
> - op(raw_cpu_ptr(&(pcp)), __VA_ARGS__); \
> - preempt_enable_notrace(); \
> -})
> -
> -#define _pcp_protect_return(op, pcp, args...) \
> -({ \
> - typeof(pcp) __retval; \
> - preempt_disable_notrace(); \
> - __retval = (typeof(pcp))op(raw_cpu_ptr(&(pcp)), ##args); \
> - preempt_enable_notrace(); \
> - __retval; \
> -})
> -
> #define _pcp_wrap(op, pcp, ...) \
> ({ \
> op(&(pcp), __VA_ARGS__); \
> -- 2.30.2
>
FWIW,
Reviewed-by: Vladimir Murzin <vladimir.murzin at arm.com>
More information about the linux-arm-kernel
mailing list