From: Catalin Marinas <catalin.marinas@arm.com>
To: Arnd Bergmann <arnd@kernel.org>
Cc: Will Deacon <will@kernel.org>, Arnd Bergmann <arnd@arndb.de>,
Jonathan Cameron <Jonathan.Cameron@huawei.com>,
Gavin Shan <gshan@redhat.com>,
Jean-Philippe Brucker <jean-philippe@linaro.org>,
James Morse <james.morse@arm.com>,
Douglas Anderson <dianders@chromium.org>,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] arm64: move smp_send_stop() cpu mask off stack
Date: Fri, 20 Jun 2025 12:24:14 +0100 [thread overview]
Message-ID: <aFVE3uuNCbHF7f5z@arm.com> (raw)
In-Reply-To: <20250620111045.3364827-1-arnd@kernel.org>
On Fri, Jun 20, 2025 at 01:10:41PM +0200, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> For really large values of CONFIG_NR_CPUS, a CPU mask value should
> not be put on the stack:
>
> arch/arm64/kernel/smp.c:1188:1: error: the frame size of 8544 bytes is larger than 1536 bytes [-Werror=frame-larger-than=]
>
> This could be achieved using alloc_cpumask_var(), which makes it
> depend on CONFIG_CPUMASK_OFFSTACK, but as this function is already
> serialized and can only run on one CPU, making the variable 'static'
> is easier.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> arch/arm64/kernel/smp.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c
> index 15987100c0cf..5c605dc7f5be 100644
> --- a/arch/arm64/kernel/smp.c
> +++ b/arch/arm64/kernel/smp.c
> @@ -1107,7 +1107,7 @@ static inline unsigned int num_other_online_cpus(void)
> void smp_send_stop(void)
> {
> static unsigned long stop_in_progress;
> - cpumask_t mask;
> + static cpumask_t mask;
> unsigned long timeout;
This would work, there's a stop_in_progress check and only one CPU would
modify the mask.
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
next prev parent reply other threads:[~2025-06-20 11:24 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-20 11:10 [PATCH] arm64: move smp_send_stop() cpu mask off stack Arnd Bergmann
2025-06-20 11:24 ` Catalin Marinas [this message]
2025-07-04 17:44 ` Will Deacon
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=aFVE3uuNCbHF7f5z@arm.com \
--to=catalin.marinas@arm.com \
--cc=Jonathan.Cameron@huawei.com \
--cc=arnd@arndb.de \
--cc=arnd@kernel.org \
--cc=dianders@chromium.org \
--cc=gshan@redhat.com \
--cc=james.morse@arm.com \
--cc=jean-philippe@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--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