* [PATCH] mm/damon/tests/core-kunit: avoid damos_test_commit stack warning
@ 2025-12-04 10:03 Arnd Bergmann
2025-12-04 15:01 ` SeongJae Park
0 siblings, 1 reply; 2+ messages in thread
From: Arnd Bergmann @ 2025-12-04 10:03 UTC (permalink / raw)
To: SeongJae Park, Andrew Morton
Cc: Arnd Bergmann, Quanmin Yan, damon, linux-mm, linux-kernel
From: Arnd Bergmann <arnd@arndb.de>
The newly added damos_test_commit() constructs multiple large structures
on the stack, which exceeds the warning limit in some cases:
In file included from mm/damon/core.c:2941:
mm/damon/tests/core-kunit.h: In function 'damos_test_commit':
mm/damon/tests/core-kunit.h:965:1: error: the frame size of 1520 bytes is larger than 1280 bytes [-Werror=frame-larger-than=]
Split this function up into two separate ones that are called sequentially,
so they can occupy the same stack slots.
Fixes: 299a88f6ec13 ("mm/damon/tests/core-kunit: add damos_commit() test")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
mm/damon/tests/core-kunit.h | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/mm/damon/tests/core-kunit.h b/mm/damon/tests/core-kunit.h
index a1eff023e928..8cb369b63e08 100644
--- a/mm/damon/tests/core-kunit.h
+++ b/mm/damon/tests/core-kunit.h
@@ -924,7 +924,7 @@ static void damos_test_commit_for(struct kunit *test, struct damos *dst,
}
}
-static void damos_test_commit(struct kunit *test)
+static void damos_test_commit_pageout(struct kunit *test)
{
damos_test_commit_for(test,
&(struct damos){
@@ -945,6 +945,10 @@ static void damos_test_commit(struct kunit *test)
DAMOS_WMARK_FREE_MEM_RATE,
800, 50, 30},
});
+}
+
+static void damos_test_commit_migrate_hot(struct kunit *test)
+{
damos_test_commit_for(test,
&(struct damos){
.pattern = (struct damos_access_pattern){
@@ -1230,7 +1234,8 @@ static struct kunit_case damon_test_cases[] = {
KUNIT_CASE(damos_test_commit_quota),
KUNIT_CASE(damos_test_commit_dests),
KUNIT_CASE(damos_test_commit_filter),
- KUNIT_CASE(damos_test_commit),
+ KUNIT_CASE(damos_test_commit_pageout),
+ KUNIT_CASE(damos_test_commit_migrate_hot),
KUNIT_CASE(damon_test_commit_target_regions),
KUNIT_CASE(damos_test_filter_out),
KUNIT_CASE(damon_test_feed_loop_next_input),
--
2.39.5
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH] mm/damon/tests/core-kunit: avoid damos_test_commit stack warning
2025-12-04 10:03 [PATCH] mm/damon/tests/core-kunit: avoid damos_test_commit stack warning Arnd Bergmann
@ 2025-12-04 15:01 ` SeongJae Park
0 siblings, 0 replies; 2+ messages in thread
From: SeongJae Park @ 2025-12-04 15:01 UTC (permalink / raw)
To: Arnd Bergmann
Cc: SeongJae Park, Andrew Morton, Arnd Bergmann, Quanmin Yan, damon,
linux-mm, linux-kernel
On Thu, 4 Dec 2025 11:03:54 +0100 Arnd Bergmann <arnd@kernel.org> wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> The newly added damos_test_commit() constructs multiple large structures
> on the stack, which exceeds the warning limit in some cases:
>
> In file included from mm/damon/core.c:2941:
> mm/damon/tests/core-kunit.h: In function 'damos_test_commit':
> mm/damon/tests/core-kunit.h:965:1: error: the frame size of 1520 bytes is larger than 1280 bytes [-Werror=frame-larger-than=]
>
> Split this function up into two separate ones that are called sequentially,
> so they can occupy the same stack slots.
Thank you for catching and fixing this, Arnd!
>
> Fixes: 299a88f6ec13 ("mm/damon/tests/core-kunit: add damos_commit() test")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: SeongJae Park <sj@kernel.org>
Thanks,
SJ
[...]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-12-04 15:01 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-12-04 10:03 [PATCH] mm/damon/tests/core-kunit: avoid damos_test_commit stack warning Arnd Bergmann
2025-12-04 15:01 ` SeongJae Park
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox