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]>

Reply via email to