On 4/29/26 2:12 AM, Mike Rapoport wrote: > From: "Mike Rapoport (Microsoft)" <[email protected]> > > A lot of tests require free HugeTLB pages. Some need just a few default > huge pages, some need a certain amount of memory available as HugeTLB, and > some just skip lots of tests if huge pages of all supported sizes are not > available. > > This all resulted in a huge mess in run_vmtests.sh that sets up some huge > pages, adjusts them later and restores some of the settings if the stars > align. > > Add APIs that allow saving the state of HugeTLB and setting up the desired > amount of HugeTLB pages. > > Saving the state also registers atexit() callback and signal handler that > will ensure restoration of HugeTLB state. > > Since many tests use both HugeTLB and THP, the atexit() callbacks and > signal handler are restoring both. > > For kselftest_harness tests that run fixture setups and test in child > processes add a constructor that will save and restore settings in the main > process. > > Signed-off-by: Mike Rapoport (Microsoft) <[email protected]> > --- Looks good to me. Reviewed-by: Sarthak Sharma <[email protected]>
- [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
- Re: [PATCH v3 28/54] selftests/mm: move read_file(), ... Sarthak Sharma
- [PATCH v3 44/54] selftests/mm: migration: add setup of Hug... Mike Rapoport
- Re: [PATCH v3 44/54] selftests/mm: migration: add set... Sarthak Sharma
- [PATCH v3 45/54] selftests/mm: pagemap_ioctl: add setup of... Mike Rapoport
- Re: [PATCH v3 45/54] selftests/mm: pagemap_ioctl: add... Sarthak Sharma
- [PATCH v3 30/54] selftests/mm: compaction_test: use HugeTL... Mike Rapoport
- Re: [PATCH v3 30/54] selftests/mm: compaction_test: u... Sarthak Sharma
- Re: [PATCH v3 30/54] selftests/mm: compaction_tes... Mike Rapoport
- [PATCH v3 31/54] selftests/mm: cow: add setup of HugeTLB p... Mike Rapoport

