[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20231213-wirrungen-angetan-6556786f194b@brauner>
Date: Wed, 13 Dec 2023 11:15:10 +0100
From: Christian Brauner <brauner@...nel.org>
To: Arnd Bergmann <arnd@...nel.org>
Cc: Alexander Viro <viro@...iv.linux.org.uk>,
Arnd Bergmann <arnd@...db.de>, Jan Kara <jack@...e.cz>,
Ian Kent <raven@...maw.net>,
Miklos Szeredi <mszeredi@...hat.com>,
"Seth Forshee (DigitalOcean)" <sforshee@...nel.org>,
Dave Chinner <dchinner@...hat.com>,
Amir Goldstein <amir73il@...il.com>,
linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] [v2] statmount: reduce runtime stack usage
On Wed, Dec 13, 2023 at 10:00:03AM +0100, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@...db.de>
>
> prepare_kstatmount() constructs a copy of 'struct kstatmount' on the stack
> and copies it into the local variable on the stack of its caller. Because
> of the size of this structure, this ends up overflowing the limit for
> a single function's stack frame when prepare_kstatmount() gets inlined
> and both copies are on the same frame without the compiler being able
> to collapse them into one:
>
> fs/namespace.c:4995:1: error: stack frame size (1536) exceeds limit (1024) in '__se_sys_statmount' [-Werror,-Wframe-larger-than]
> 4995 | SYSCALL_DEFINE4(statmount, const struct mnt_id_req __user *, req,
>
> Replace the assignment with an in-place memset() plus assignment that
> should always be more efficient for both stack usage and runtime cost.
>
> Fixes: 49889374ab92 ("statmount: simplify string option retrieval")
> Signed-off-by: Arnd Bergmann <arnd@...db.de>
> ---
I folded this patch and placed a link here. Thanks!
Powered by blists - more mailing lists