selftests: vm: add test for Soft-Dirty PTE bit
authorMuhammad Usama Anjum <usama.anjum@collabora.com>
Mon, 28 Feb 2022 23:06:37 +0000 (10:06 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Tue, 1 Mar 2022 09:31:48 +0000 (20:31 +1100)
commite437208fb4426613c3ada68eec7c0995cf6bfe94
tree5d5b176f03d75f0af6d33bc62e857e4454f1195d
parent9979e4b51991f34519e7de1ba3445c71cd2747d9
selftests: vm: add test for Soft-Dirty PTE bit

This introduces three tests:
1) Sanity check soft dirty basic semantics: allocate area, clean, dirty,
check if the SD bit flipped.
2) Check VMA reuse: validate the VM_SOFTDIRTY usage
3) Check soft-dirty on huge pages

This was motivated by Will Deacon's fix commit 912efa17e512 ("mm: proc:
Invalidate TLB after clearing soft-dirty page state").  I was tracking the
same issue that he fixed, and this test would have caught it.

Link: https://lkml.kernel.org/r/20220224212335.3045905-1-usama.anjum@collabora.com
Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.com>
Signed-off-by: Muhammad Usama Anjum <usama.anjum@collabora.com>
Cc: Will Deacon <will@kernel.org>
Cc: Shuah Khan <shuah@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
tools/testing/selftests/vm/.gitignore
tools/testing/selftests/vm/Makefile
tools/testing/selftests/vm/config
tools/testing/selftests/vm/soft-dirty.c [new file with mode: 0644]