Re: [PATCH v3 2/3] selftests/mm: test userspace MFR for HugeTLB hugepage

From: Miaohe Lin

Date: Mon Feb 09 2026 - 07:01:55 EST


On 2026/2/4 3:23, Jiaqi Yan wrote:
> Test the userspace memory failure recovery (MFR) policy for HugeTLB:
>
> 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.
>
> Reviewed-by: Jane Chu <jane.chu@xxxxxxxxxx>
> Signed-off-by: Jiaqi Yan <jiaqiyan@xxxxxxxxxx>

It's not required but could this testcase be written into the tools/testing/selftests/mm/memory-failure.c [1]?

[1] https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git/commit/?h=mm-unstable&id=cf2929c618fec0a22702b3abd0778bbdde6e458e

Thanks.
.