From: Mike Rapoport (Microsoft) Date: Mon, 11 May 2026 16:28:28 +0000 (+0300) Subject: selftests/mm: hugetlb-vmemmap: add setup of HugeTLB pages X-Git-Tag: v7.2-rc1~59^2~40 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=496a662f73292d98e1d91917f2b2f9ec1d130fdc;p=thirdparty%2Fkernel%2Flinux.git selftests/mm: hugetlb-vmemmap: add setup of HugeTLB pages hugetlb-vmemmap test fails if there are no free huge pages prepared by a wrapper script. Add setup of HugeTLB pages to the test and make sure that the original settings are restored on the test exit. Link: https://lore.kernel.org/20260511162840.375890-45-rppt@kernel.org Signed-off-by: Mike Rapoport (Microsoft) Tested-by: Luiz Capitulino Tested-by: Sarthak Sharma Cc: Baolin Wang Cc: Barry Song Cc: David Hildenbrand Cc: Dev Jain Cc: Donet Tom Cc: Jason Gunthorpe Cc: John Hubbard Cc: Lance Yang Cc: Leon Romanovsky Cc: Liam Howlett Cc: Li Wang Cc: Lorenzo Stoakes Cc: Mark Brown Cc: Michal Hocko Cc: Nico Pache Cc: Peter Xu Cc: Ryan Roberts Cc: Shuah Khan Cc: Suren Baghdasaryan Cc: Vlastimil Babka Cc: Zi Yan Signed-off-by: Andrew Morton --- diff --git a/tools/testing/selftests/mm/hugetlb-vmemmap.c b/tools/testing/selftests/mm/hugetlb-vmemmap.c index af5786bebfd1d..507df78a158d8 100644 --- a/tools/testing/selftests/mm/hugetlb-vmemmap.c +++ b/tools/testing/selftests/mm/hugetlb-vmemmap.c @@ -97,6 +97,9 @@ int main(int argc, char **argv) ksft_print_header(); ksft_set_plan(1); + if (!hugetlb_setup_default(1)) + ksft_exit_skip("Not enough free huge pages\n"); + pagesize = psize(); maplength = default_huge_page_size(); if (!maplength)