Re: [PATCH v2 11/12] arm64: sched/preempt: Enable HAS_SEPARATE_PREEMPT_RESCHED_BITS

Peter Zijlstra <[email protected]> Thu, 28 May 2026 12:50:58 +0200
Newsgroups org.kernel.vger.linux-openrisc,org.kernel.vger.bpf,org.kernel.vger.linux-arch,org.kernel.vger.linux-kernel,org.kernel.vger.linux-kselftest,org.kernel.vger.linux-s390,org.kernel.vger.rust-for-linux
Message-ID <[email protected]>
On Tue, May 26, 2026 at 08:21:47AM -0700, Boqun Feng wrote:
> ARM64 already uses 64bit preempt count and the need reschedule bit is
> maintained in a separate 32bit than the preempt count. Therefore preempt
> count has enough bits to represent 16 level of NMI nesting, hence enable
> it for ARM64. This saves a per-CPU variable and additional instructions
> in the NMI path.

Egads, so ARM being load-store gets around the preempt bit scribble by
moving it into a separate word. And while that works, that does *not*
make the preempt_count 64bit.

All of this really only works because the actual preempt count bits
still fit inside a u32. The moment that changes, this comes unstuck :-(

And I suppose this is the reason Mark wanted that name change.

I suppose Power could employ the same scheme..


> Signed-off-by: Boqun Feng <[email protected]>
> ---
>  arch/arm64/Kconfig | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
> index fe60738e5943..8178cb857115 100644
> --- a/arch/arm64/Kconfig
> +++ b/arch/arm64/Kconfig
> @@ -248,6 +248,7 @@ config ARM64
>  	select PCI_SYSCALL if PCI
>  	select POWER_RESET
>  	select POWER_SUPPLY
> +	select HAS_SEPARATE_PREEMPT_RESCHED_BITS
>  	select SPARSE_IRQ
>  	select SWIOTLB
>  	select SYSCTL_EXCEPTION_TRACE
> -- 
> 2.50.1 (Apple Git-155)
>