On 10/14/26 11:27 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 through different
> paths: a dirty shared file page must be written back or left resident,
> shared anonymous memory is paged out through shmem, and a SHM_LOCK'd
> segment is unevictable without its VMA being VM_LOCKED.
> 
> Check that MADV_COLD and MADV_PAGEOUT preserve a dirty shared file page,
> that MADV_PAGEOUT preserves a shared anonymous page, and that it leaves a
> SHM_LOCK'd page resident. The SHM_LOCK test needs root to confirm through
> /proc/kpageflags that the page is unevictable, and skips if it is not.
> 
> Signed-off-by: Gregory Price (Meta) <[email protected]>
> ---
>  tools/testing/selftests/mm/madvise.c | 138 +++++++++++++++++++++++++++
>  tools/testing/selftests/mm/vm_util.h |   1 +
>  2 files changed, 139 insertions(+)
LGTM

Reviewed-by: Sarthak Sharma <[email protected]>

Reply via email to