selftests: vm: add KSM unmerge test
authorZhansaya Bagdauletkyzy <zhansayabagdaulet@gmail.com>
Thu, 2 Sep 2021 22:00:42 +0000 (15:00 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 3 Sep 2021 16:58:18 +0000 (09:58 -0700)
commita40c80e348fac4ecff8abcc3fae31e2e84c055d6
tree97203ca56b66a3a3d369ce2467616f8d28e25689
parent68d6289baa35c5e59b5359577d3dc01c00c437d2
selftests: vm: add KSM unmerge test

Add check_ksm_unmerge() function to verify that KSM is properly unmerging
shared pages.  For this, two duplicate pages are merged first and then
their contents are modified.  Since they are not identical anymore, the
pages must be unmerged and the number of merged pages has to be 0.  The
test is run as follows: ./ksm_tests -U

Link: https://lkml.kernel.org/r/c0f55420440d704d5b094275b4365aa1b2ad46b5.1626252248.git.zhansayabagdaulet@gmail.com
Signed-off-by: Zhansaya Bagdauletkyzy <zhansayabagdaulet@gmail.com>
Reviewed-by: Pavel Tatashin <pasha.tatashin@soleen.com>
Reviewed-by: Tyler Hicks <tyhicks@linux.microsoft.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: Shuah Khan <shuah@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
tools/testing/selftests/vm/ksm_tests.c
tools/testing/selftests/vm/run_vmtests.sh