Skip to contentSkip to conversation

selftests-mm-uffd-unit-test-check-if-huge-page-size-is-0.patch removed from -mm tree

merged mm-hotfixes-stable Andrew Morton 1 participant 1 message Feb 20, 2024 Stable branch

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: selftests/mm: uffd-unit-test check if huge page size is 0
has been removed from the -mm tree. Its filename was
selftests-mm-uffd-unit-test-check-if-huge-page-size-is-0.patch

This patch was dropped because it was merged into the mm-hotfixes-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

------------------------------------------------------
From: Terry Tritton <[email protected]>
Subject: selftests/mm: uffd-unit-test check if huge page size is 0
Date: Mon, 5 Feb 2024 14:50:56 +0000

If HUGETLBFS is not enabled then the default_huge_page_size function will return 0 and cause a divide by 0 error. Add a check to see if the huge page size is 0 and skip the hugetlb tests if it is.

Fixes 16a45b57cbf2 ("selftests/mm: add framework for uffd-unit-test")
Cc Peter Griffin <[email protected]>
Cc Shuah Khan <[email protected]>
Cc Peter Xu <[email protected]>

---

 tools/testing/selftests/mm/uffd-unit-tests.c |    6 ++++++
 1 file changed, 6 insertions(+)
tools/testing/selftests/mm/uffd-unit-tests.c renamed from tools/testing/selftests/mm/uffd-unit-tests.c~selftests-mm-uffd-unit-test-check-if-huge-page-size-is-0 +6 -0
@@ -1517,6 +1517,12 @@ int main(int argc, char *argv[])
 				continue;
 
 			uffd_test_start("%s on %s", test->name, mem_type->name);
+			if ((mem_type->mem_flag == MEM_HUGETLB ||
+			    mem_type->mem_flag == MEM_HUGETLB_PRIVATE) &&
+			    (default_huge_page_size() == 0)) {
+				uffd_test_skip("huge page size is 0, feature missing?");
+				continue;
+			}
 			if (!uffd_feature_supported(test)) {
 				uffd_test_skip("feature missing");
 				continue;

_

Patches currently in -mm which might be from [email protected] are