linux/tools/testing/selftests/vm
Zhansaya Bagdauletkyzy 924a11bd16 selftests: vm: add COW time test for KSM pages
Since merged pages are copied every time they need to be modified, the
write access time is different between shared and non-shared pages.  Add
ksm_cow_time() function which evaluates latency of these COW breaks.
First, 4000 pages are allocated and the time, required to modify 1 byte in
every other page, is measured.  After this, the pages are merged into 2000
pairs and in each pair, 1 page is modified (i.e.  they are decoupled) to
detect COW breaks.  The time needed to break COW of merged pages is then
compared with performance of non-shared pages.

The test is run as follows: ./ksm_tests -C
The output:
	Total size:    15 MiB

	Not merged pages:
	Total time:     0.002185489 s
	Average speed:  3202.945 MiB/s

	Merged pages:
	Total time:     0.004386872 s
	Average speed:  1595.670 MiB/s

Link: https://lkml.kernel.org/r/1d03ee0d1b341959d4b61672c6401d498bff5652.1629386192.git.zhansayabagdaulet@gmail.com
Signed-off-by: Zhansaya Bagdauletkyzy <zhansayabagdaulet@gmail.com>
Reviewed-by: Tyler Hicks <tyhicks@linux.microsoft.com>
Reviewed-by: Pavel Tatashin <pasha.tatashin@soleen.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2021-09-03 09:58:18 -07:00
..
.gitignore selftests: vm: add KSM merge test 2021-09-03 09:58:18 -07:00
Makefile selftests: vm: add KSM merging across nodes test 2021-09-03 09:58:18 -07:00
charge_reserved_hugetlb.sh selftests/vm: use kselftest skip code for skipped tests 2021-09-03 09:58:13 -07:00
check_config.sh
compaction_test.c
config
gup_test.c
hmm-tests.c
hugepage-mmap.c
hugepage-shm.c
hugetlb_reparenting_test.sh selftests/vm: use kselftest skip code for skipped tests 2021-09-03 09:58:13 -07:00
khugepaged.c
ksm_tests.c selftests: vm: add COW time test for KSM pages 2021-09-03 09:58:18 -07:00
madv_populate.c
map_fixed_noreplace.c
map_hugetlb.c
map_populate.c
memfd_secret.c
mlock-random-test.c selftests: Fix spelling mistake "cann't" -> "cannot" 2021-09-03 09:58:13 -07:00
mlock2-tests.c
mlock2.h
mremap_dontunmap.c
mremap_test.c selftest/mremap_test: avoid crash with static build 2021-07-08 11:48:22 -07:00
on-fault-limit.c
pkey-helpers.h
pkey-powerpc.h
pkey-x86.h
protection_keys.c
run_vmtests.sh selftests: vm: add KSM merging across nodes test 2021-09-03 09:58:18 -07:00
split_huge_page_test.c
test_hmm.sh
test_vmalloc.sh
thuge-gen.c
transhuge-stress.c
userfaultfd.c selftests/vm/userfaultfd: wake after copy failure 2021-09-03 09:58:16 -07:00
va_128TBswitch.c
virtual_address_range.c
write_hugetlb_memory.sh
write_to_hugetlbfs.c