Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Breno Leitao <leitao@debian.org>
To: Will Deacon <will@kernel.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>,
	 Mark Rutland <mark.rutland@arm.com>,
	linux-arm-kernel@lists.infradead.org,
	 linux-kernel@vger.kernel.org, kas@kernel.org,
	kernel-team@meta.com
Subject: Re: [PATCH] arm64: Kconfig: Don't select CPUMASK_OFFSTACK with 64K pages
Date: Fri, 30 Oct 2026 03:46:03 -0700	[thread overview]
Message-ID: <auR0kSCYyo31Inxf@gmail.com> (raw)
In-Reply-To: <auRxNDAe_tv-mCvk@willie-the-truck>

Hello Will,

On Fri, Oct 30, 2026 at 10:28:04AM +0000, Will Deacon wrote:
> On Tue, Oct 27, 2026 at 04:59:52AM -0700, Breno Leitao wrote:
> > On Wed, Oct 07, 2026 at 12:58:16AM -0700, Breno Leitao wrote:
> > > arm64 selects CPUMASK_OFFSTACK when NR_CPUS is above 256, which keeps
> > > cpumask_var_t off the kernel stack. With 64K pages the kernel stack is
> > > 64K as well, we have enough room to keep cpumask on the stack, avoiding
> > > extra alocation and possible performance penalties.
> > > 
> > > Skip the select when ARM64_64K_PAGES is set. A 64K kernel can then raise
> > > NR_CPUS above 256 and keep cpumask_var_t as an inline array. 4K and 16K
> > > page kernels are unchanged.
> > > 
> > > Signed-off-by: Breno Leitao <leitao@debian.org>
> > > ---
> > > Based on Will presentation at LPC, I've decided to have a look at Meta's
> > > stack usage, and I found that this might be an small optimization!?
> > > ---
> > >  arch/arm64/Kconfig | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > > 
> > > diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
> > > index 5f2db2cecf9772..b73371327d2a47 100644
> > > --- a/arch/arm64/Kconfig
> > > +++ b/arch/arm64/Kconfig
> > > @@ -111,7 +111,7 @@ config ARM64
> > >  	select CLONE_BACKWARDS
> > >  	select COMMON_CLK
> > >  	select CPU_PM if (SUSPEND || CPU_IDLE)
> > > -	select CPUMASK_OFFSTACK if NR_CPUS > 256
> > > +	select CPUMASK_OFFSTACK if NR_CPUS > 256 && !ARM64_64K_PAGES
> > 
> > Does this one sound sane?
> 
> It doesn't make an awful lot of sense to me, to be honest. The page size
> and the number of CPUs are two independent variables, so tying them
> together like this looks a little odd.

Sure, but with 64K pages the kernel stack is _huge_. Why do we still
need to keep the cpumask off the stack frame in that case?


  reply	other threads:[~2026-10-30 10:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-07  7:58 [PATCH] arm64: Kconfig: Don't select CPUMASK_OFFSTACK with 64K pages Breno Leitao
2026-10-27 11:59 ` Breno Leitao
2026-10-30 10:28   ` Will Deacon
2026-10-30 10:46     ` Breno Leitao [this message]
2026-10-30 11:53       ` Will Deacon
2026-10-30 13:50         ` Breno Leitao

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=auR0kSCYyo31Inxf@gmail.com \
    --to=leitao@debian.org \
    --cc=catalin.marinas@arm.com \
    --cc=kas@kernel.org \
    --cc=kernel-team@meta.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox