[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aFVE3uuNCbHF7f5z@arm.com>
Date: Fri, 20 Jun 2025 12:24:14 +0100
From: Catalin Marinas <catalin.marinas@....com>
To: Arnd Bergmann <arnd@...nel.org>
Cc: Will Deacon <will@...nel.org>, Arnd Bergmann <arnd@...db.de>,
Jonathan Cameron <Jonathan.Cameron@...wei.com>,
Gavin Shan <gshan@...hat.com>,
Jean-Philippe Brucker <jean-philippe@...aro.org>,
James Morse <james.morse@....com>,
Douglas Anderson <dianders@...omium.org>,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] arm64: move smp_send_stop() cpu mask off stack
On Fri, Jun 20, 2025 at 01:10:41PM +0200, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@...db.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@...db.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@....com>
Powered by blists - more mailing lists