Re: [PATCH v2 2/2] selftests/mm: load xfs before checking for it in run_vmtests.sh

From: Jose A. Perez de Azpillaga

Date: Wed Oct 28 2026 - 04:14:32 EST


On 10/17/26 5:07 PM, Qiliang Yuan wrote:
> run_vmtests.sh creates a loop-mounted XFS for "khugepaged all:file" and
> for the pagecache folio split cases of split_huge_page_test, since
> tmpfs does not give them large pagecache folios.
>
> It only does so when xfs already shows up in /proc/filesystems. When
> xfs is built as a module that is not loaded yet, the check fails, no
> XFS is created, "khugepaged all:file" is reported as skipped and every
> pagecache folio split case of split_huge_page_test is skipped with "No
> large pagecache folio generated".
>
> Load xfs with load_module() when it is not registered yet, so that it
> is unloaded again once the script is done. "run_vmtests.sh -t thp" with
> xfs built as a module and not loaded:
>
> before after
> skipped tests 1 0
> skipped split_huge_page_test cases 43 0
> xfs loaded after the run no no
>
> Fixes: fc4d182316bd ("mm: huge_memory: enable debugfs to split huge pages to any order")
> Signed-off-by: Qiliang Yuan <odys.yuan@xxxxxxxxx>
> ---
> tools/testing/selftests/mm/run_vmtests.sh | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/testing/selftests/mm/run_vmtests.sh b/tools/testing/selftests/mm/run_vmtests.sh
> index 56f5416681da7..ba77fae5df4f2 100755
> --- a/tools/testing/selftests/mm/run_vmtests.sh
> +++ b/tools/testing/selftests/mm/run_vmtests.sh
> @@ -428,7 +428,7 @@ CATEGORY="thp" run_test ./khugepaged -c 4 mthp_khugepaged:anon
> # Try to create XFS if not provided
> if [ -z "${SPLIT_HUGE_PAGE_TEST_XFS_PATH}" ]; then
> if test_selected "thp"; then
> - if grep xfs /proc/filesystems &>/dev/null; then
> + if grep -q xfs /proc/filesystems || load_module xfs; then

doesn't this also match selinuxfs? with SELinux on, xfs is still loaded
after the run. would grep -qw be enough?

also, needs a rebase, 6593a15af108 ("selftests/mm: skip khugepaged file
tests if mkfs.xfs is unavailable") reworked these lines.

--
cheers,
jose a. p-a