Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

selftests/mm: split_huge_page_test: skip the test when thp is not available

When thp is not enabled on some kernel config such as realtime kernel, the
test will report failure. Fix the false positive by skipping the test
directly when thp is not enabled.

Tested with thp disabled kernel:
Before The fix:
# --------------------------------------------------
# running ./split_huge_page_test /tmp/xfs_dir_Ywup9p
# --------------------------------------------------
# TAP version 13
# Bail out! Reading PMD pagesize failed
# # Totals: pass:0 fail:0 xfail:0 xpass:0 skip:0 error:0
# [FAIL]
not ok 61 split_huge_page_test /tmp/xfs_dir_Ywup9p # exit=1

After the fix:
# --------------------------------------------------
# running ./split_huge_page_test /tmp/xfs_dir_YHPUPl
# --------------------------------------------------
# TAP version 13
# 1..0 # SKIP Transparent Hugepages not available
# [SKIP]
ok 6 split_huge_page_test /tmp/xfs_dir_YHPUPl # SKIP

Link: https://lore.kernel.org/20260402014543.1671131-6-chuhu@redhat.com
Signed-off-by: Chunyu Hu <chuhu@redhat.com>
Acked-by: David Hildenbrand (Arm) <david@kernel.org>
Reviewed-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
Reviewed-by: Lorenzo Stoakes (Oracle) <ljs@kernel.org>
Reviewed-by: Zi Yan <ziy@nvidia.com>
Cc: Li Wang <liwang@redhat.com>
Cc: Nico Pache <npache@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Chunyu Hu and committed by
Andrew Morton
dad4964a a784a3a3

+4
+4
tools/testing/selftests/mm/split_huge_page_test.c
··· 21 21 #include <time.h> 22 22 #include "vm_util.h" 23 23 #include "kselftest.h" 24 + #include "thp_settings.h" 24 25 25 26 uint64_t pagesize; 26 27 unsigned int pageshift; ··· 757 756 ksft_print_msg("Please run the benchmark as root\n"); 758 757 ksft_finished(); 759 758 } 759 + 760 + if (!thp_is_enabled()) 761 + ksft_exit_skip("Transparent Hugepages not available\n"); 760 762 761 763 if (argc > 1) 762 764 optional_xfs_path = argv[1];