Run the stress test with PMD splitting failure injection enabled (if supported). Keep in mind that vmemmap PMDs are only ever split, never collapsed back to PMDs, so run this step first, before the main stress test. Signed-off-by: James Houghton --- tools/testing/selftests/mm/hugetlb_vmemmap_stress.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tools/testing/selftests/mm/hugetlb_vmemmap_stress.sh b/tools/testing/selftests/mm/hugetlb_vmemmap_stress.sh index 61b7fecb1141..0bb8c264c25a 100755 --- a/tools/testing/selftests/mm/hugetlb_vmemmap_stress.sh +++ b/tools/testing/selftests/mm/hugetlb_vmemmap_stress.sh @@ -4,13 +4,16 @@ # Stress test for HugeTLB vmemmap optimization (HVO). # # Phases: -# 1. accounting: allocate N hugepages, check that nr_memmap_pages + +# 1. pmd-inject: churn the pool with fail_hugetlb_vmemmap_pmd enabled. +# Runs first because vmemmap PMDs are only split once, so later phases +# would leave few PMD splits to fail. +# 2. accounting: allocate N hugepages, check that nr_memmap_pages + # nr_memmap_boot_pages drops by exactly N * (vmemmap pages per folio - 1), # then free them and check it returns to the baseline. -# 2. stress: churn the pool (optimize/restore) while concurrently reading +# 3. stress: churn the pool (optimize/restore) while concurrently reading # struct pages (/proc/kpageflags, /proc/kpagecount), compacting memory, # and optionally reading page_owner and offlining/onlining memory. -# 3. pte-inject: like 2, with fail_hugetlb_vmemmap_pte enabled; this hits +# 4. pte-inject: like 2, with fail_hugetlb_vmemmap_pte enabled; this hits # both the optimize rollback and the restore (partial HVO) paths. # # After each phase the pool is drained back to its original size, memmap @@ -296,7 +299,7 @@ cleanup() { local t stop_workers - for t in fail_hugetlb_vmemmap_pte; do + for t in fail_hugetlb_vmemmap_pte fail_hugetlb_vmemmap_pmd; do [ -d "$(fa_dir $t)" ] && fa_disable $t > /dev/null done reonline_blocks @@ -374,6 +377,7 @@ accounting_phase() { echo "$marker" > /dev/kmsg +stress_phase pmd-inject fail_hugetlb_vmemmap_pmd accounting_phase stress_phase stress "" stress_phase pte-inject fail_hugetlb_vmemmap_pte -- 2.56.1.839.g22a8290db9-goog