]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
mm/selftests: fix split_huge_page_test failure on systems with 64KB page size
authorDonet Tom <donettom@linux.ibm.com>
Sat, 16 Aug 2025 04:01:10 +0000 (09:31 +0530)
committerAndrew Morton <akpm@linux-foundation.org>
Sat, 13 Sep 2025 23:55:03 +0000 (16:55 -0700)
commit7bc857ddeeaa35a059f6e645365526e10e1f3511
tree9500d80a4c10ee7cf17560156c861b79277eec03
parent08c907c5bc0ae8c9f0741c9622366ed30a1f6232
mm/selftests: fix split_huge_page_test failure on systems with 64KB page size

The split_huge_page_test fails on systems with a 64KB base page size.
This is because the order of a 2MB huge page is different:

On 64KB systems, the order is 5.

On 4KB systems, it's 9.

The test currently assumes a maximum huge page order of 9, which is only
valid for 4KB base page systems.  On systems with 64KB pages, attempting
to split huge pages beyond their actual order (5) causes the test to fail.

In this patch, we calculate the huge page order based on the system's base
page size.  With this change, the tests now run successfully on both 64KB
and 4KB page size systems.

Link: https://lkml.kernel.org/r/20250816040113.760010-5-aboorvad@linux.ibm.com
Fixes: fa6c02315f74 ("mm: huge_memory: a new debugfs interface for splitting THP tests")
Co-developed-by: Aboorva Devarajan <aboorvad@linux.ibm.com>
Signed-off-by: Aboorva Devarajan <aboorvad@linux.ibm.com>
Signed-off-by: Donet Tom <donettom@linux.ibm.com>
Reviewed-by: Dev Jain <dev.jain@arm.com>
Reviewed-by: Zi Yan <ziy@nvidia.com>
Reviewed-by: Wei Yang <richard.weiyang@gmail.com>
Cc: Baolin Wang <baolin.wang@linux.alibaba.com>
Cc: Barry Song <baohua@kernel.org>
Cc: David Hildenbrand <david@redhat.com>
Cc: Liam Howlett <liam.howlett@oracle.com>
Cc: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Cc: Mariano Pache <npache@redhat.com>
Cc: "Ritesh Harjani (IBM)" <ritesh.list@gmail.com>
Cc: Ryan Roberts <ryan.roberts@arm.com>
Cc: Shuah Khan <shuah@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
tools/testing/selftests/mm/cow.c
tools/testing/selftests/mm/split_huge_page_test.c
tools/testing/selftests/mm/uffd-wp-mremap.c
tools/testing/selftests/mm/vm_util.h