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 06:50:18 -0700 [thread overview]
Message-ID: <auSem6kzc2d52n-H@gmail.com> (raw)
In-Reply-To: <auSFVKVuGryqTgjG@willie-the-truck>
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?
Thanks,
--breno
--
PS: I am not pushing on this patch at all, I am just trying to
understand the reasoning and learn.
prev parent reply other threads:[~2026-10-30 13:50 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
2026-10-30 11:53 ` Will Deacon
2026-10-30 13:50 ` Breno Leitao [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=auSem6kzc2d52n-H@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.