On 10/14/26 11:27 PM, Gregory Price (Meta) wrote: > Paging out a THP that the advised range fully covers must not corrupt it. > A THP that the range only partly covers must be split before reclaim, or > skipped, so that no page outside the range is reclaimed. MADV_COLD takes > the same split path. > > Check that a whole PMD-mapped THP is swapped intact, that pages outside > the range stay resident after paging out a base page or half of a PMD- or > PTE-mapped THP, and that MADV_COLD on half of either THP preserves its > contents. Tests skip when PMD-sized THPs cannot be allocated, and with > /proc/kpageflags the PTE-mapped cases also confirm the folio stayed large. > > Signed-off-by: Gregory Price (Meta) <[email protected]> > --- > tools/testing/selftests/mm/madvise.c | 234 +++++++++++++++++++++++++++ > 1 file changed, 234 insertions(+) > Looks good to me. Reviewed-by: Sarthak Sharma <[email protected]>
- [PATCH 0/8] selftests/mm: add MADV_COLD and MADV_PAGE... Gregory Price (Meta)
- [PATCH 1/8] selftests/mm: add MADV_COLD and MADV... Gregory Price (Meta)
- Re: [PATCH 1/8] selftests/mm: add MADV_COLD ... Sarthak Sharma
- [PATCH 3/8] selftests/mm: check MADV_COLD and MA... Gregory Price (Meta)
- [PATCH] fixup! selftests/mm: check MADV_COLD... Gregory Price (Meta)
- Re: [PATCH 3/8] selftests/mm: check MADV_COL... Sarthak Sharma
- Re: [PATCH 3/8] selftests/mm: check MADV... Gregory Price
- Re: [PATCH 3/8] selftests/mm: check ... Gregory Price
- Re: [PATCH 3/8] selftests/mm: c... Sarthak Sharma
- [PATCH 6/8] selftests/mm: check MADV_COLD and MA... Gregory Price (Meta)
- Re: [PATCH 6/8] selftests/mm: check MADV_COL... Sarthak Sharma
- [PATCH 7/8] selftests/mm: check MADV_PAGEOUT fil... Gregory Price (Meta)
- Re: [PATCH 7/8] selftests/mm: check MADV_PAG... Sarthak Sharma
- Re: [PATCH 7/8] selftests/mm: check MADV... Gregory Price
- Re: [PATCH 7/8] selftests/mm: check ... Sarthak Sharma
- [PATCH 5/8] selftests/mm: check that MADV_COLD a... Gregory Price (Meta)
- Re: [PATCH 5/8] selftests/mm: check that MAD... Sarthak Sharma
- [PATCH 8/8] selftests/mm: check that unauthorize... Gregory Price (Meta)
- Re: [PATCH 8/8] selftests/mm: check that una... Gregory Price
- Re: [PATCH 8/8] selftests/mm: check that una... Sarthak Sharma
- [PATCH 2/8] selftests/mm: check that MADV_PAGEOU... Gregory Price (Meta)

