From: Mike Rapoport (Microsoft) Date: Mon, 11 May 2026 16:28:36 +0000 (+0300) Subject: selftests/mm: va_high_addr_switch: add setup of HugeTLB pages X-Git-Tag: v7.2-rc1~59^2~32 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c9e5d1fc951dbce768dc7e7d998c72fd3d589764;p=thirdparty%2Fkernel%2Flinux.git selftests/mm: va_high_addr_switch: add setup of HugeTLB pages va_high_addr_switch skips HugeTLB tests 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-53-rppt@kernel.org Signed-off-by: Mike Rapoport (Microsoft) Reviewed-by: Luiz Capitulino 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/va_high_addr_switch.c b/tools/testing/selftests/mm/va_high_addr_switch.c index 0b69bd4b901db..e24d7ba00b441 100644 --- a/tools/testing/selftests/mm/va_high_addr_switch.c +++ b/tools/testing/selftests/mm/va_high_addr_switch.c @@ -325,7 +325,7 @@ int main(int argc, char **argv) if (!supported_arch()) ksft_exit_skip("Architecture not supported\n"); - if (argc == 2 && !strcmp(argv[1], "--run-hugetlb")) + if (hugetlb_setup_default(6)) run_hugetlb = true; testcases_init();