On 4/29/26 2:12 AM, Mike Rapoport wrote: > From: "Mike Rapoport (Microsoft)" <[email protected]> > > 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. > > Signed-off-by: Mike Rapoport (Microsoft) <[email protected]> I have run the test before and after applying the patch. Before the patch, the test bailed out with mmap error if there was not exactly 1 free hugepage. After the patch, the test correctly allocates the hugepage and successfully passes, restoring the hugepage settings at exit. Tested-by: Sarthak Sharma <[email protected]> > --- > tools/testing/selftests/mm/hugetlb-vmemmap.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/tools/testing/selftests/mm/hugetlb-vmemmap.c > b/tools/testing/selftests/mm/hugetlb-vmemmap.c > index af5786bebfd1..507df78a158d 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)
- [PATCH v3 25/54] selftests/mm: hugepage_settings: add APIs... Mike Rapoport
- Re: [PATCH v3 25/54] selftests/mm: hugepage_settings:... Luiz Capitulino
- Re: [PATCH v3 25/54] selftests/mm: hugepage_settings:... Sarthak Sharma
- [PATCH v3 38/54] selftests/mm: hugetlb_madv_vs_map: add se... Mike Rapoport
- Re: [PATCH v3 38/54] selftests/mm: hugetlb_madv_vs_ma... Sarthak Sharma
- [PATCH v3 22/54] selftests/mm: rename thp_settings.[ch] to... Mike Rapoport
- Re: [PATCH v3 22/54] selftests/mm: rename thp_setting... Sarthak Sharma
- [PATCH v3 29/54] selftests/mm: vm_util: add helpers to set... Mike Rapoport
- Re: [PATCH v3 29/54] selftests/mm: vm_util: add helpe... Sarthak Sharma
- [PATCH v3 43/54] selftests/mm: hugetlb-vmemmap: add setup ... Mike Rapoport
- Re: [PATCH v3 43/54] selftests/mm: hugetlb-vmemmap: a... Sarthak Sharma
- [PATCH v3 41/54] selftests/mm: hugetlb-shm: add setup of H... Mike Rapoport
- Re: [PATCH v3 41/54] selftests/mm: hugetlb-shm: add s... Sarthak Sharma
- [PATCH v3 27/54] selftests/mm: hugepage_settings: add APIs... Mike Rapoport
- Re: [PATCH v3 27/54] selftests/mm: hugepage_settings:... Luiz Capitulino
- Re: [PATCH v3 27/54] selftests/mm: hugepage_setti... Mike Rapoport
- Re: [PATCH v3 27/54] selftests/mm: hugepage_s... Luiz Capitulino
- Re: [PATCH v3 27/54] selftests/mm: hugepa... Mike Rapoport
- Re: [PATCH v3 27/54] selftests/mm: h... Luiz Capitulino
- Re: [PATCH v3 27/54] selftests/mm: hugepage_settings:... Sarthak Sharma
- [PATCH v3 28/54] selftests/mm: move read_file(), read_num(... Mike Rapoport

