]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
selftests/mm: run_vmtests.sh: don't gate THP and KSM tests on HAVE_HUGEPAGES
authorMike Rapoport (Microsoft) <rppt@kernel.org>
Mon, 11 May 2026 16:27:49 +0000 (19:27 +0300)
committerAndrew Morton <akpm@linux-foundation.org>
Sun, 21 Jun 2026 18:37:18 +0000 (11:37 -0700)
HAVE_HUGEPAGES indicates availability of free HugeTLB pages.  It should
not be used to gate KSM test that merges transparent huge pages or
split_huge_page_test.

Remove check for HAVE_HUGEPAGES when running these tests.

Link: https://lore.kernel.org/20260511162840.375890-6-rppt@kernel.org
Signed-off-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
Tested-by: Li Wang <li.wang@linux.dev>
Reviewed-by: Li Wang <li.wang@linux.dev>
Tested-by: Luiz Capitulino <luizcap@redhat.com>
Cc: Baolin Wang <baolin.wang@linux.alibaba.com>
Cc: Barry Song <baohua@kernel.org>
Cc: David Hildenbrand <david@kernel.org>
Cc: Dev Jain <dev.jain@arm.com>
Cc: Donet Tom <donettom@linux.ibm.com>
Cc: Jason Gunthorpe <jgg@ziepe.ca>
Cc: John Hubbard <jhubbard@nvidia.com>
Cc: Lance Yang <lance.yang@linux.dev>
Cc: Leon Romanovsky <leon@kernel.org>
Cc: Liam Howlett <liam@infradead.org>
Cc: Lorenzo Stoakes <ljs@kernel.org>
Cc: Mark Brown <broonie@kernel.org>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Nico Pache <npache@redhat.com>
Cc: Peter Xu <peterx@redhat.com>
Cc: Ryan Roberts <ryan.roberts@arm.com>
Cc: Sarthak Sharma <sarthak.sharma@arm.com>
Cc: Shuah Khan <shuah@kernel.org>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Vlastimil Babka <vbabka@kernel.org>
Cc: Zi Yan <ziy@nvidia.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
tools/testing/selftests/mm/run_vmtests.sh

index b73921b2cac02360683a30fb667d433136a35a12..61a01d2bc22075fe80ecff533550a5acde4eb39d 100755 (executable)
@@ -437,9 +437,7 @@ CATEGORY="memfd_secret" run_test ./memfd_secret
 fi
 
 # KSM KSM_MERGE_TIME_HUGE_PAGES test with size of 100
-if [ "${HAVE_HUGEPAGES}" = "1" ]; then
-       CATEGORY="ksm" run_test ./ksm_tests -H -s 100
-fi
+CATEGORY="ksm" run_test ./ksm_tests -H -s 100
 # KSM KSM_MERGE_TIME test with size of 100
 CATEGORY="ksm" run_test ./ksm_tests -P -s 100
 # KSM MADV_MERGEABLE test with 10 identical pages
@@ -492,16 +490,14 @@ CATEGORY="thp" run_test ./khugepaged -s 4 all:shmem
 
 # Try to create XFS if not provided
 if [ -z "${SPLIT_HUGE_PAGE_TEST_XFS_PATH}" ]; then
-    if [ "${HAVE_HUGEPAGES}" = "1" ]; then
-       if test_selected "thp"; then
-           if grep xfs /proc/filesystems &>/dev/null; then
-               XFS_IMG=$(mktemp /tmp/xfs_img_XXXXXX)
-               SPLIT_HUGE_PAGE_TEST_XFS_PATH=$(mktemp -d /tmp/xfs_dir_XXXXXX)
-               truncate -s 314572800 ${XFS_IMG}
-               mkfs.xfs -q ${XFS_IMG}
-               mount -o loop ${XFS_IMG} ${SPLIT_HUGE_PAGE_TEST_XFS_PATH}
-               MOUNTED_XFS=1
-           fi
+    if test_selected "thp"; then
+       if grep xfs /proc/filesystems &>/dev/null; then
+           XFS_IMG=$(mktemp /tmp/xfs_img_XXXXXX)
+           SPLIT_HUGE_PAGE_TEST_XFS_PATH=$(mktemp -d /tmp/xfs_dir_XXXXXX)
+           truncate -s 314572800 ${XFS_IMG}
+           mkfs.xfs -q ${XFS_IMG}
+           mount -o loop ${XFS_IMG} ${SPLIT_HUGE_PAGE_TEST_XFS_PATH}
+           MOUNTED_XFS=1
        fi
     fi
 fi