Re: [PATCH v3 4/7] selftests/mm: check that MADV_COLD and MADV_PAGEOUT preserve shared memory

From: Sarthak Sharma

Date: Wed Oct 28 2026 - 07:24:40 EST




On 10/19/26 10:42 PM, Gregory Price (Meta) wrote:
> Both hints are non-destructive, but the tests so far only check that for
> private anonymous memory. Shared memory reaches reclaim differently:
>
> Test the following:
> - a dirty shared file page must be written back or left resident,
> - shared anonymous memory is paged out through shmem
> - a SHM_LOCK'd segment is unevictable without its VMA being VM_LOCKED.
>
> MADV_PAGEOUT unmaps a shmem page before it tries to swap it out
> so none of these needs swap.
>
> The SHM_LOCK test confirms the page is unevictable and skips otherwise.
>
> Signed-off-by: Gregory Price (Meta) <gourry@xxxxxxxxxx>
> ---
> v3: Dropped Sarthak's Reviewed-by from v2 5/8: added the fixture check
> for hidden PFNs and create_temp_file(), and the shared anonymous
> test now fails rather than skips when the page is not unmapped.


LGTM, so:

Reviewed-by: Sarthak Sharma <sarthak.sharma@xxxxxxx>