Re: lib/maple_tree.c:4056:1: error: the frame size of 1144 bytes is larger than 1024 bytes
From: Liam R. Howlett
Date: Fri Jan 31 2025 - 10:09:35 EST
* Wei Yang <richard.weiyang@xxxxxxxxx> [250131 08:37]:
> On Thu, Jan 30, 2025 at 11:31:50PM +0100, Scall wrote:
> >On 1/30/25 5:13 PM, Liam R. Howlett wrote:
> >> Do you have KASAN or lock debugging on?
> >
> >No, I don't.
> >
> >> Does the issue go away when reverting 8c7904a8cd0df ("maple_tree: i is
> >> always less than or equal to mas_end") ?
> >
> >That commit has not been backported to the kernel version I tried to build
> >(6.12.11, currently the latest stable version).
> >
> >Good news: I learned that the issue has already been solved in the mainline
> >version with commit 5059aa6334fcf ("maple_tree: memset maple_big_node as a
> >whole") and backporting it is the solution.
>
> Hmm... I tried to reproduce this and found different gcc version may behave
> differently. An old version doesn't report warning while a later version does.
>
> With GCC 8.2.1, the latest master looks good. Even I use -O3.
>
> 7004a2e46d16 2025-01-22 Merge tag 'linux_kselftest-nolibc-6.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest
>
> But with GCC 11.4.0(I don't have the exact version as yours), the latest
> master still get a warning. But the message is a little bit different from
> yours:
>
> lib/maple_tree.c: In function ‘mas_wr_spanning_store’:
> lib/maple_tree.c:3804:1: warning: the frame size of 1040 bytes is larger than 1024 bytes [-Wframe-larger-than=]
> 3804 | }
> | ^
> lib/maple_tree.c: In function ‘mas_wr_bnode’:
> lib/maple_tree.c:4065:1: warning: the frame size of 1048 bytes is larger than 1024 bytes [-Wframe-larger-than=]
> 4065 | }
> | ^
>
> Then I tried to bisect it. And found similar warning even at the first maple
> tree commit 54a611b60590 ("Maple Tree: add new data structure"). Below is the
> warning message:
>
> lib/maple_tree.c: In function ‘mas_wr_spanning_store.isra’:
> lib/maple_tree.c:4047:1: warning: the frame size of 1032 bytes is larger than 1024 bytes [-Wframe-larger-than=]
> 4047 | }
> | ^
> lib/maple_tree.c: In function ‘mas_wr_bnode’:
> lib/maple_tree.c:4325:1: warning: the frame size of 1040 bytes is larger than 1024 bytes [-Wframe-larger-than=]
> 4325 | }
> | ^
>
> Hi, Liam
>
> Do you have some suggestion on what I can do to help?
No, this isn't worth chasing down.
The proper fix is to remove the big node, but that's really involved and
I'm working on it.
Thanks,
Liam