Re: [PATCH v4 03/15] selftests/mm: restore default nr_hugepages value via EXIT trap in hugetlb_reparenting_test.sh
From: Zi Yan
Date: Tue Apr 07 2026 - 10:48:15 EST
On 6 Apr 2026, at 5:19, Sayali Patil wrote:
> The test modifies nr_hugepages during execution and restores it from
> cleanup() and again reconfigure it setup, which is invoked multiple
> times across test flow. This can lead to repeated
> allocation/freeing of hugepages.
>
> With set -e, failures in cleanup (e.g., rmdir/umount) can also
> cause early exit before restoring the original value at the end.
>
> Move restoration to a single EXIT trap so the original value is
> restored reliably on all exit paths while avoiding repeated churn.
>
> Fixes: 585a9145886a ("selftests/mm: restore default nr_hugepages value during cleanup in hugetlb_reparenting_test.sh")
> Signed-off-by: Sayali Patil <sayalip@xxxxxxxxxxxxx>
> ---
> tools/testing/selftests/mm/hugetlb_reparenting_test.sh | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
Acked-by: Zi Yan <ziy@xxxxxxxxxx>
Best Regards,
Yan, Zi