Re: [PATCH v4 2/3] selftests/mm: test userspace MFR for HugeTLB hugepage
From: William Roche
Date: Tue Nov 24 2026 - 19:19:33 EST
About the selftest:
The Linux documentation indicates that there is no fixed debugfs mount
point, so we should probably discover the debugfs mount point instead
of assuming it is always /sys/kernel/debug/
My March 20 version did that, but I haven't found a C test program
within selftests that dynamically does that.
So maybe keeping the "/sys/kernel/debug/" would be an acceptable
implementation, and could also be an explicit test prerequisite,
with a clear skip if the interface is unavailable.
I would also suggest to load the hwpoison_inject module before starting.
Something like that should be enough:
r = system("modprobe hwpoison_inject");
if (r != 0) {
ksft_test_result_fail("Can't probe hwpoison_inject kernel module");
return -1;
}
Just in case it's not already there, and we would like to support a
standalone invocation.
I also agree with Chris: The default test should run on 2M pages to
have a better chance to run because of lower requirements.
By default, I would even suggest running 2M test first, followed by the
1G test when that size is supported and sufficient HugeTLB pages are
available.
HTH,
William.