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

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
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -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);
	}