[PATCH v4 03/15] selftests/mm: restore default nr_hugepages value via EXIT trap in hugetlb_reparenting_test.sh

Zi Yan ziy at nvidia.com
Wed Apr 8 00:39:23 AEST 2026


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 at linux.ibm.com>
> ---
>  tools/testing/selftests/mm/hugetlb_reparenting_test.sh | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
Acked-by: Zi Yan <ziy at nvidia.com>

Best Regards,
Yan, Zi


More information about the Linuxppc-dev mailing list