Commit dd63bd7d authored by Zi Yan's avatar Zi Yan Committed by Andrew Morton

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: c07c343c ("selftests/vm: dedup THP helpers")
Signed-off-by: default avatarZi Yan <ziy@nvidia.com>
Reviewed-by: default avatarZach O'Keefe <zokeefe@google.com>
Tested-by: default avatarZach O'Keefe <zokeefe@google.com>
Acked-by: default avatarDavid Hildenbrand <david@redhat.com>
Cc: Shuah Khan <shuah@kernel.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent 99c29133
...@@ -106,7 +106,7 @@ void split_pmd_thp(void) ...@@ -106,7 +106,7 @@ void split_pmd_thp(void)
for (i = 0; i < len; i++) for (i = 0; i < len; i++)
one_page[i] = (char)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"); printf("No THP is allocated\n");
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
...@@ -122,7 +122,7 @@ void split_pmd_thp(void) ...@@ -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"); printf("Still AnonHugePages not split\n");
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
...@@ -169,7 +169,7 @@ void split_pte_mapped_thp(void) ...@@ -169,7 +169,7 @@ void split_pte_mapped_thp(void)
for (i = 0; i < len; i++) for (i = 0; i < len; i++)
one_page[i] = (char)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"); printf("No THP is allocated\n");
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment