> All khugepaged collapse cases are written against PMD collapse: the > regions, the thresholds and the detection (smaps AnonHugePages, which > only accounts PMD mappings) all assume the PMD-order product. The mTHP > collapse support merged in 7.2 has no functional selftest coverage. > > Add an -o <order> mode running order-parameterized anon collapse cases > against khugepaged. The region is faulted to order 0 first (the target > order is "inherit" under enabled=madvise, so pre-MADV_HUGEPAGE faults > cannot produce large folios), then one full khugepaged pass is awaited > via the full_scans barrier, and results are detected per aligned > window with the vm_util folio-order helpers:
Having options is usefull for targeted testing, but I think that the default should be to run all supported confugrations, like e.g. cow test does. That's the point of a selftest: check that everything works. Can we refactor the existing code so that simple 'khugepaged' invocation will test everything it can before adding new options and tests? -- Sincerely yours, Mike.

