Re: [PATCH v2 5/5] selftests/mm: transhuge_stress: skip the test when thp not available
From: David Hildenbrand (Arm)
Date: Mon Mar 16 2026 - 10:17:20 EST
On 3/16/26 05:43, 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@xxxxxxxxxx>
> Reviewed-by: Zi Yan <ziy@xxxxxxxxxx>
> CC: Li Wang <liwang@xxxxxxxxxx>
> Signed-off-by: Chunyu Hu <chuhu@xxxxxxxxxx>
> ---
Acked-by: David Hildenbrand (Arm) <david@xxxxxxxxxx>
--
Cheers,
David