Re: [RESEND PATCH 4/4] selftests/mm: transhuge_stress: skip the test when thp not available

Zi Yan
2026-03-12T14:11:57Z

On 12 Mar 2026, at 7:40, Chunyu Hu wrote:

> The test requires thp, skip the test when thp is not available to avoid
> false positive.
>
> Tested with thp disabled kernel.
> Before the fix:
> # --------------------------------
> # running ./transhuge-stress -d 20
> # --------------------------------
> # TAP version 13
> # 1..1
> # transhuge-stress: allocate 1453 transhuge pages, using 2907 MiB virtual memory and 11 MiB of ram
> # Bail out! MADV_HUGEPAGE# Planned tests != run tests (1 != 0)
> # # Totals: pass:0 fail:0 xfail:0 xpass:0 skip:0 error:0
> # [FAIL]
> not ok 60 transhuge-stress -d 20 # exit=1
>
> After the fix:
> # --------------------------------
> # running ./transhuge-stress -d 20
> # --------------------------------
> # 1..0 # SKIP Transparent Hugepages not available
> # [SKIP]
> ok 5 transhuge-stress -d 20 # SKIP
>
> CC: Li Wang <liwang@redhat.com>
> Signed-off-by: Chunyu Hu <chuhu@redhat.com>
> ---
> tools/testing/selftests/mm/transhuge-stress.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
LGTM.

Reviewed-by: Zi Yan <ziy@nvidia.com>

Best Regards,
Yan, Zi