mm/damon/tests/vaddr-kunit.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
Hi all,
After merging the mm tree, today's linux-next build (powerpc allyesconfig)
failed like this:
In file included from mm/damon/vaddr.c:736:
mm/damon/tests/vaddr-kunit.h: In function 'damon_test_three_regions_in_vmas':
mm/damon/tests/vaddr-kunit.h:92:1: error: the frame size of 3280 bytes is larger than 2048 bytes [-Werror=frame-larger-than=]
92 | }
| ^
Presumably caused by commit
062111898568 ("mm: move per-vma lock into vm_area_struct")
I have applied the following hack for today.
From: Stephen Rothwell <sfr@canb.auug.org.au>
Date: Mon, 9 Dec 2024 16:33:16 +1100
Subject: [PATCH] fix up for "mm: move per-vma lock into vm_area_struct"
on PowerPC that change causes a frame size error
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
mm/damon/tests/vaddr-kunit.h | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/mm/damon/tests/vaddr-kunit.h b/mm/damon/tests/vaddr-kunit.h
index b9fe3bc8472b..564373fadf38 100644
--- a/mm/damon/tests/vaddr-kunit.h
+++ b/mm/damon/tests/vaddr-kunit.h
@@ -14,6 +14,7 @@
#include <kunit/test.h>
+#ifdef notdef
static int __link_vmas(struct maple_tree *mt, struct vm_area_struct *vmas,
ssize_t nr_vmas)
{
@@ -90,6 +91,7 @@ static void damon_test_three_regions_in_vmas(struct kunit *test)
KUNIT_EXPECT_EQ(test, 300ul, regions[2].start);
KUNIT_EXPECT_EQ(test, 330ul, regions[2].end);
}
+#endif
static struct damon_region *__nth_region_of(struct damon_target *t, int idx)
{
@@ -306,7 +308,7 @@ static void damon_test_split_evenly(struct kunit *test)
}
static struct kunit_case damon_test_cases[] = {
- KUNIT_CASE(damon_test_three_regions_in_vmas),
+ // KUNIT_CASE(damon_test_three_regions_in_vmas),
KUNIT_CASE(damon_test_apply_three_regions1),
KUNIT_CASE(damon_test_apply_three_regions2),
KUNIT_CASE(damon_test_apply_three_regions3),
--
2.45.2
--
Cheers,
Stephen Rothwell
On Mon, 9 Dec 2024 17:08:29 +1100 Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> Hi all,
>
> After merging the mm tree, today's linux-next build (powerpc allyesconfig)
> failed like this:
>
> In file included from mm/damon/vaddr.c:736:
> mm/damon/tests/vaddr-kunit.h: In function 'damon_test_three_regions_in_vmas':
> mm/damon/tests/vaddr-kunit.h:92:1: error: the frame size of 3280 bytes is larger than 2048 bytes [-Werror=frame-larger-than=]
> 92 | }
> | ^
>
> Presumably caused by commit
>
> 062111898568 ("mm: move per-vma lock into vm_area_struct")
>
How about this?
From: Andrew Morton <akpm@linux-foundation.org>
Subject: mm/damon/tests/vaddr-kunit.h: reduce stack consumption
Date: Mon Dec 9 06:20:01 PM PST 2024
After "mm: move per-vma lock into vm_area_struct" we're hitting
mm/damon/tests/vaddr-kunit.h: In function 'damon_test_three_regions_in_vmas':
mm/damon/tests/vaddr-kunit.h:92:1: error: the frame size of 3280 bytes is larger than 2048 bytes [-Werror=frame-larger-than=]
Fix by moving all those vmas off the stack.
Closes: https://lkml.kernel.org/r/20241209170829.11311e70@canb.auug.org.au
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: SeongJae Park <sj@kernel.org>
Cc: Suren Baghdasaryan <surenb@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
mm/damon/tests/vaddr-kunit.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/mm/damon/tests/vaddr-kunit.h~mm-damon-tests-vaddr-kunith-reduce-stack-consumption
+++ a/mm/damon/tests/vaddr-kunit.h
@@ -68,7 +68,7 @@ static void damon_test_three_regions_in_
static struct mm_struct mm;
struct damon_addr_range regions[3] = {0};
/* 10-20-25, 200-210-220, 300-305, 307-330 */
- struct vm_area_struct vmas[] = {
+ static const struct vm_area_struct vmas[] = {
(struct vm_area_struct) {.vm_start = 10, .vm_end = 20},
(struct vm_area_struct) {.vm_start = 20, .vm_end = 25},
(struct vm_area_struct) {.vm_start = 200, .vm_end = 210},
_
Hi Andrew,
On Mon, 9 Dec 2024 18:25:57 -0800 Andrew Morton <akpm@linux-foundation.org> wrote:
>
> How about this?
Unfortunately:
In file included from mm/damon/vaddr.c:736:
mm/damon/tests/vaddr-kunit.h: In function 'damon_test_three_regions_in_vmas':
mm/damon/tests/vaddr-kunit.h:81:36: error: passing argument 2 of '__link_vmas' discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers]
81 | if (__link_vmas(&mm.mm_mt, vmas, ARRAY_SIZE(vmas)))
| ^~~~
mm/damon/tests/vaddr-kunit.h:17:70: note: expected 'struct vm_area_struct *' but argument is of type 'const struct vm_area_struct *'
17 | static int __link_vmas(struct maple_tree *mt, struct vm_area_struct *vmas,
| ~~~~~~~~~~~~~~~~~~~~~~~^~~~
--
Cheers,
Stephen Rothwell
On Tue, 10 Dec 2024 16:00:11 +1100 Stephen Rothwell <sfr@canb.auug.org.au> wrote: > On Mon, 9 Dec 2024 18:25:57 -0800 Andrew Morton <akpm@linux-foundation.org> wrote: > > > > How about this? > > Unfortunately: > > In file included from mm/damon/vaddr.c:736: > mm/damon/tests/vaddr-kunit.h: In function 'damon_test_three_regions_in_vmas': > mm/damon/tests/vaddr-kunit.h:81:36: error: passing argument 2 of '__link_vmas' discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers] > 81 | if (__link_vmas(&mm.mm_mt, vmas, ARRAY_SIZE(vmas))) > | ^~~~ > mm/damon/tests/vaddr-kunit.h:17:70: note: expected 'struct vm_area_struct *' but argument is of type 'const struct vm_area_struct *' > 17 | static int __link_vmas(struct maple_tree *mt, struct vm_area_struct *vmas, > | ~~~~~~~~~~~~~~~~~~~~~~~^~~~ Bah. OK, I'll drop the const.
On Mon, 9 Dec 2024 18:25:57 -0800 Andrew Morton <akpm@linux-foundation.org> wrote:
> On Mon, 9 Dec 2024 17:08:29 +1100 Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>
> > Hi all,
> >
> > After merging the mm tree, today's linux-next build (powerpc allyesconfig)
> > failed like this:
> >
> > In file included from mm/damon/vaddr.c:736:
> > mm/damon/tests/vaddr-kunit.h: In function 'damon_test_three_regions_in_vmas':
> > mm/damon/tests/vaddr-kunit.h:92:1: error: the frame size of 3280 bytes is larger than 2048 bytes [-Werror=frame-larger-than=]
> > 92 | }
> > | ^
> >
> > Presumably caused by commit
> >
> > 062111898568 ("mm: move per-vma lock into vm_area_struct")
> >
>
> How about this?
>
>
> From: Andrew Morton <akpm@linux-foundation.org>
> Subject: mm/damon/tests/vaddr-kunit.h: reduce stack consumption
> Date: Mon Dec 9 06:20:01 PM PST 2024
>
> After "mm: move per-vma lock into vm_area_struct" we're hitting
>
> mm/damon/tests/vaddr-kunit.h: In function 'damon_test_three_regions_in_vmas':
> mm/damon/tests/vaddr-kunit.h:92:1: error: the frame size of 3280 bytes is larger than 2048 bytes [-Werror=frame-larger-than=]
>
> Fix by moving all those vmas off the stack.
>
>
> Closes: https://lkml.kernel.org/r/20241209170829.11311e70@canb.auug.org.au
> Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
> Cc: SeongJae Park <sj@kernel.org>
> Cc: Suren Baghdasaryan <surenb@google.com>
> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Reviewed-by: SeongJae Park <sj@kernel.org>
Thank you for this quick fix, Andrew.
> ---
>
> mm/damon/tests/vaddr-kunit.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> --- a/mm/damon/tests/vaddr-kunit.h~mm-damon-tests-vaddr-kunith-reduce-stack-consumption
> +++ a/mm/damon/tests/vaddr-kunit.h
> @@ -68,7 +68,7 @@ static void damon_test_three_regions_in_
> static struct mm_struct mm;
> struct damon_addr_range regions[3] = {0};
> /* 10-20-25, 200-210-220, 300-305, 307-330 */
> - struct vm_area_struct vmas[] = {
> + static const struct vm_area_struct vmas[] = {
> (struct vm_area_struct) {.vm_start = 10, .vm_end = 20},
> (struct vm_area_struct) {.vm_start = 20, .vm_end = 25},
> (struct vm_area_struct) {.vm_start = 200, .vm_end = 210},
> _
Thanks,
SJ
On Mon, Dec 9, 2024 at 6:25 PM Andrew Morton <akpm@linux-foundation.org> wrote:
>
> On Mon, 9 Dec 2024 17:08:29 +1100 Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>
> > Hi all,
> >
> > After merging the mm tree, today's linux-next build (powerpc allyesconfig)
> > failed like this:
> >
> > In file included from mm/damon/vaddr.c:736:
> > mm/damon/tests/vaddr-kunit.h: In function 'damon_test_three_regions_in_vmas':
> > mm/damon/tests/vaddr-kunit.h:92:1: error: the frame size of 3280 bytes is larger than 2048 bytes [-Werror=frame-larger-than=]
> > 92 | }
> > | ^
> >
> > Presumably caused by commit
> >
> > 062111898568 ("mm: move per-vma lock into vm_area_struct")
> >
>
> How about this?
This looks like a good fix. Thanks!
>
>
> From: Andrew Morton <akpm@linux-foundation.org>
> Subject: mm/damon/tests/vaddr-kunit.h: reduce stack consumption
> Date: Mon Dec 9 06:20:01 PM PST 2024
>
> After "mm: move per-vma lock into vm_area_struct" we're hitting
>
> mm/damon/tests/vaddr-kunit.h: In function 'damon_test_three_regions_in_vmas':
> mm/damon/tests/vaddr-kunit.h:92:1: error: the frame size of 3280 bytes is larger than 2048 bytes [-Werror=frame-larger-than=]
>
> Fix by moving all those vmas off the stack.
>
>
> Closes: https://lkml.kernel.org/r/20241209170829.11311e70@canb.auug.org.au
> Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
> Cc: SeongJae Park <sj@kernel.org>
> Cc: Suren Baghdasaryan <surenb@google.com>
> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
> ---
>
> mm/damon/tests/vaddr-kunit.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> --- a/mm/damon/tests/vaddr-kunit.h~mm-damon-tests-vaddr-kunith-reduce-stack-consumption
> +++ a/mm/damon/tests/vaddr-kunit.h
> @@ -68,7 +68,7 @@ static void damon_test_three_regions_in_
> static struct mm_struct mm;
> struct damon_addr_range regions[3] = {0};
> /* 10-20-25, 200-210-220, 300-305, 307-330 */
> - struct vm_area_struct vmas[] = {
> + static const struct vm_area_struct vmas[] = {
> (struct vm_area_struct) {.vm_start = 10, .vm_end = 20},
> (struct vm_area_struct) {.vm_start = 20, .vm_end = 25},
> (struct vm_area_struct) {.vm_start = 200, .vm_end = 210},
> _
>
© 2016 - 2025 Red Hat, Inc.