tools/testing/selftests: add mremap() unfaulted/faulted test cases
authorLorenzo Stoakes <lorenzo.stoakes@oracle.com>
Wed, 2 Jul 2025 08:47:17 +0000 (09:47 +0100)
committerAndrew Morton <akpm@linux-foundation.org>
Sun, 13 Jul 2025 23:38:25 +0000 (16:38 -0700)
commit4e25f85b9f85d238fe012cb18cd040172344d7e6
treee21e2f37ce72f84c57f0d1db88f2a3b54593683f
parent526f36f3f47b9ad29ffb1bf668b7f295287ee11b
tools/testing/selftests: add mremap() unfaulted/faulted test cases

Assert that mremap() behaviour is as expected when moving around unfaulted
VMAs immediately adjacent to faulted ones, as well as moving around
faulted VMAs and placing them back immediately adjacent to the VMA from
which they were moved.

This also introduces a shared helper for the syscall version of mremap()
so we don't encounter any issues with libc filtering parameters.

Link: https://lkml.kernel.org/r/20250702084717.21360-1-lorenzo.stoakes@oracle.com
Signed-off-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Cc: Jann Horn <jannh@google.com>
Cc: Liam Howlett <liam.howlett@oracle.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
tools/testing/selftests/mm/merge.c
tools/testing/selftests/mm/vm_util.c
tools/testing/selftests/mm/vm_util.h