Skip to content

Commit dafdba0

Browse files
arndbakpm00
authored andcommitted
mm/damon/tests/core-kunit: avoid damos_test_commit stack warning
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. Link: https://lkml.kernel.org/r/20251204100403.1034980-1-arnd@kernel.org Fixes: 299a88f ("mm/damon/tests/core-kunit: add damos_commit() test") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: SeongJae Park <sj@kernel.org> Cc: Quanmin Yan <yanquanmin1@huawei.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
1 parent 49d921b commit dafdba0

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

mm/damon/tests/core-kunit.h

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -924,7 +924,7 @@ static void damos_test_commit_for(struct kunit *test, struct damos *dst,
924924
}
925925
}
926926

927-
static void damos_test_commit(struct kunit *test)
927+
static void damos_test_commit_pageout(struct kunit *test)
928928
{
929929
damos_test_commit_for(test,
930930
&(struct damos){
@@ -945,6 +945,10 @@ static void damos_test_commit(struct kunit *test)
945945
DAMOS_WMARK_FREE_MEM_RATE,
946946
800, 50, 30},
947947
});
948+
}
949+
950+
static void damos_test_commit_migrate_hot(struct kunit *test)
951+
{
948952
damos_test_commit_for(test,
949953
&(struct damos){
950954
.pattern = (struct damos_access_pattern){
@@ -1230,7 +1234,8 @@ static struct kunit_case damon_test_cases[] = {
12301234
KUNIT_CASE(damos_test_commit_quota),
12311235
KUNIT_CASE(damos_test_commit_dests),
12321236
KUNIT_CASE(damos_test_commit_filter),
1233-
KUNIT_CASE(damos_test_commit),
1237+
KUNIT_CASE(damos_test_commit_pageout),
1238+
KUNIT_CASE(damos_test_commit_migrate_hot),
12341239
KUNIT_CASE(damon_test_commit_target_regions),
12351240
KUNIT_CASE(damos_test_filter_out),
12361241
KUNIT_CASE(damon_test_feed_loop_next_input),

0 commit comments

Comments
 (0)