Re: [PATCH 04/16] selftests/mm: add order-parameterized khugepaged collapse cases

Mike Rapoport <[email protected]> Mon, 03 Aug 2026 14:04:23 +0300
Newsgroups org.kernel.vger.linux-kselftest,org.kernel.vger.linux-kernel,org.kvack.linux-mm
Message-ID <178575506331.1561566.14498717581313061864.b4-review@b4>
> 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.