From: Will Deacon <will@kernel.org>
To: Breno Leitao <leitao@debian.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, 27 Nov 2026 18:43:00 +0000 [thread overview]
Message-ID: <awnPNMn6AIH17d_K@willie-the-truck> (raw)
In-Reply-To: <auSem6kzc2d52n-H@gmail.com>
On Fri, Oct 30, 2026 at 06:50:18AM -0700, Breno Leitao wrote:
> On Fri, Oct 30, 2026 at 11:53:56AM +0000, Will Deacon wrote:
> > Because you might have thousands of CPUs?
>
> I checked that case. I built defconfig with 64K pages and NR_CPUS=4096,
> with and without this patch, and compared clang's -fstack-usage output.
>
> With the patch, 62 functions grow by 512 bytes or more. The worst are in
> cpuset: update_prstate(), cpuset_write_resmask() and
> cpuset_handle_hotplug() grow by ~1.5K, to 1648 bytes. Nothing crosses
> FRAME_WARN, and the largest frame in the build goes from 1312 to 1648
> bytes, out of a 64K stack.
>
> I believe this higher frame usage is still way better than the kmalloc
> at function invocation (the reason for this patch), but honestly I don't
> have real numbers, and I am happy to take them, if it is worth.
>
> > Because copying these things by value could be expensive?
>
> Hmm, I _think_ having the cpumask on the stack or not doesn't change how
> it is passed. cpumask_var_t is either a pointer or a one-element array,
> which decays to a pointer, so callees get a struct cpumask * in both
> cases.
>
> Which copies do you have in mind?
Fair enough, I hadn't looked too closely into that. But the fundamental
observation remains that the page size and the number of CPUs are
unrelated.
Will
prev parent reply other threads:[~2026-11-27 18:43 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-07 7:58 Breno Leitao
2026-10-27 11:59 ` Breno Leitao
2026-10-30 10:28 ` Will Deacon
2026-10-30 10:46 ` Breno Leitao
2026-10-30 11:53 ` Will Deacon
2026-10-30 13:50 ` Breno Leitao
2026-11-27 18:43 ` Will Deacon [this message]
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=awnPNMn6AIH17d_K@willie-the-truck \
--to=will@kernel.org \
--cc=catalin.marinas@arm.com \
--cc=kas@kernel.org \
--cc=kernel-team@meta.com \
--cc=leitao@debian.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
/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
all inboxes | Powered by JetHome®