From: Wei Yang Date: Sat, 9 Aug 2025 19:42:09 +0000 (+0000) Subject: selftests/mm: do check_huge_anon() with a number been passed in X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=54523014580095c0e92f5a4a0a4f2c7b96a2dff4;p=users%2Fjedix%2Flinux-maple.git selftests/mm: do check_huge_anon() with a number been passed in Currently it hard codes the number of hugepage to check for check_huge_anon(), but it would be more reasonable to do the check based on a number passed in. Pass in the hugepage number and do the check based on it. Link: https://lkml.kernel.org/r/20250809194209.30484-1-richard.weiyang@gmail.com Signed-off-by: Wei Yang Reviewed by: Donet Tom Reviewed-by: Baolin Wang Acked-by: David Hildenbrand Reviewed-by: Zi Yan Reviewed-by: Vishal Moola (Oracle) Reviewed-by: wang lian Cc: Dev Jain Cc: Lorenzo Stoakes Signed-off-by: Andrew Morton --- diff --git a/tools/testing/selftests/mm/split_huge_page_test.c b/tools/testing/selftests/mm/split_huge_page_test.c index 44a3f8a588067..bf40e6b121abc 100644 --- a/tools/testing/selftests/mm/split_huge_page_test.c +++ b/tools/testing/selftests/mm/split_huge_page_test.c @@ -111,7 +111,7 @@ static void verify_rss_anon_split_huge_page_all_zeroes(char *one_page, int nr_hp unsigned long rss_anon_before, rss_anon_after; size_t i; - if (!check_huge_anon(one_page, 4, pmd_pagesize)) + if (!check_huge_anon(one_page, nr_hpages, pmd_pagesize)) ksft_exit_fail_msg("No THP is allocated\n"); rss_anon_before = rss_anon();