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

Mike Rapoport
2026-03-16T06:30:21Z

On Mon, Mar 16, 2026 at 12:43:35PM +0800, 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
> # --------------------------------
> # TAP version 13
> # 1..0 # SKIP Transparent Hugepages not available
> # [SKIP]
> ok 5 transhuge-stress -d 20 # SKIP
>
> Reviewed-by: Lorenzo Stoakes (Oracle) <ljs@kernel.org>
> Reviewed-by: Zi Yan <ziy@nvidia.com>
> CC: Li Wang <liwang@redhat.com>
> Signed-off-by: Chunyu Hu <chuhu@redhat.com>

Reviewed-by: Mike Rapoport (Microsoft) <rppt@kernel.org>

--
Sincerely yours,
Mike.