From: Zi Yan Date: Mon, 6 Mar 2023 16:09:07 +0000 (-0500) Subject: selftests/mm: fix split huge page tests X-Git-Tag: v6.6.17~4989^2~328 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=dd63bd7df41a8f9393a2e3ff9157a441c08eb996;p=platform%2Fkernel%2Flinux-rpi.git selftests/mm: fix split huge page tests Fix two inputs to check_anon_huge() and one if condition, so the tests work as expected. Link: https://lkml.kernel.org/r/20230306160907.16804-1-zi.yan@sent.com Fixes: c07c343cda8e ("selftests/vm: dedup THP helpers") Signed-off-by: Zi Yan Reviewed-by: Zach O'Keefe Tested-by: Zach O'Keefe Acked-by: David Hildenbrand Cc: Shuah Khan 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 76e1c36..b8558c7 100644 --- a/tools/testing/selftests/mm/split_huge_page_test.c +++ b/tools/testing/selftests/mm/split_huge_page_test.c @@ -106,7 +106,7 @@ void split_pmd_thp(void) for (i = 0; i < len; i++) one_page[i] = (char)i; - if (!check_huge_anon(one_page, 1, pmd_pagesize)) { + if (!check_huge_anon(one_page, 4, pmd_pagesize)) { printf("No THP is allocated\n"); exit(EXIT_FAILURE); } @@ -122,7 +122,7 @@ void split_pmd_thp(void) } - if (check_huge_anon(one_page, 0, pmd_pagesize)) { + if (!check_huge_anon(one_page, 0, pmd_pagesize)) { printf("Still AnonHugePages not split\n"); exit(EXIT_FAILURE); } @@ -169,7 +169,7 @@ void split_pte_mapped_thp(void) for (i = 0; i < len; i++) one_page[i] = (char)i; - if (!check_huge_anon(one_page, 1, pmd_pagesize)) { + if (!check_huge_anon(one_page, 4, pmd_pagesize)) { printf("No THP is allocated\n"); exit(EXIT_FAILURE); }