Re: [PATCH v3 2/3] selftests/mm: test userspace MFR for HugeTLB hugepage
From: William Roche
Date: Wed Feb 04 2026 - 12:55:12 EST
On 2/3/26 20:23, Jiaqi Yan wrote:
Test the userspace memory failure recovery (MFR) policy for HugeTLB:In this version, you are introducing this new test argument
1. Create a memfd backed by HugeTLB and had MFD_MF_KEEP_UE_MAPPED set.
2. Allocate and map 4 hugepages to the process.
3. Create sub-threads to MADV_HWPOISON inner addresses of the 1st hugepage.
4. Check if the process gets correct SIGBUS for each poisoned raw page.
5. Check if all memory are still accessible and content valid.
6. Check if the poisoned hugepage is dealt with after memfd released.
Two configurables in the test:
- hugepage_size: size of the hugepage, 1G or 2M.
- nr_hwp_pages: number of pages within the 1st hugepage to MADV_HWPOISON.
"nr_hwp_pages" to indicate how many of the pre-defined offsets we want
to poison inside the hugepage (between 1 and 8).
But is there any advantage to give the choice to the user instead of
testing them all ?
As a suggestion, should we have this test program setting or verifying
the minimal number of hugepages of the right type, instead of relying on
the user to set them manually ?
And at the end, should we try to unpoison the impacted pages ? So that
the lab machine where the tests run can continue to use all its memory ?
Thanks for your feedback,
William.