linux/tools/testing/selftests/kvm
Maciej S. Szmigiero cad347fab1 KVM: selftests: add a memslot-related performance benchmark
This benchmark contains the following tests:
* Map test, where the host unmaps guest memory while the guest writes to
it (maps it).

The test is designed in a way to make the unmap operation on the host
take a negligible amount of time in comparison with the mapping
operation in the guest.

The test area is actually split in two: the first half is being mapped
by the guest while the second half in being unmapped by the host.
Then a guest <-> host sync happens and the areas are reversed.

* Unmap test which is broadly similar to the above map test, but it is
designed in an opposite way: to make the mapping operation in the guest
take a negligible amount of time in comparison with the unmap operation
on the host.
This test is available in two variants: with per-page unmap operation
or a chunked one (using 2 MiB chunk size).

* Move active area test which involves moving the last (highest gfn)
memslot a bit back and forth on the host while the guest is
concurrently writing around the area being moved (including over the
moved memslot).

* Move inactive area test which is similar to the previous move active
area test, but now guest writes all happen outside of the area being
moved.

* Read / write test in which the guest writes to the beginning of each
page of the test area while the host writes to the middle of each such
page.
Then each side checks the values the other side has written.
This particular test is not expected to give different results depending
on particular memslots implementation, it is meant as a rough sanity
check and to provide insight on the spread of test results expected.

Each test performs its operation in a loop until a test period ends
(this is 5 seconds by default, but it is configurable).
Then the total count of loops done is divided by the actual elapsed
time to give the test result.

The tests have a configurable memslot cap with the "-s" test option, by
default the system maximum is used.
Each test is repeated a particular number of times (by default 20
times), the best result achieved is printed.

The test memory area is divided equally between memslots, the reminder
is added to the last memslot.
The test area size does not depend on the number of memslots in use.

The tests also measure the time that it took to add all these memslots.
The best result from the tests that use the whole test area is printed
after all the requested tests are done.

In general, these tests are designed to use as much memory as possible
(within reason) while still doing 100+ loops even on high memslot counts
with the default test length.
Increasing the test runtime makes it increasingly more likely that some
event will happen on the system during the test run, which might lower
the test result.

Signed-off-by: Maciej S. Szmigiero <maciej.szmigiero@oracle.com>
Reviewed-by: Andrew Jones <drjones@redhat.com>
Message-Id: <8d31bb3d92bc8fa33a9756fa802ee14266ab994e.1618253574.git.maciej.szmigiero@oracle.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2021-05-27 07:45:54 -04:00
..
aarch64 KVM: selftests: vgic_init kvm selftests fixup 2021-04-07 15:50:50 +01:00
include KVM/arm64 updates for Linux 5.13 2021-04-23 07:41:17 -04:00
lib KVM: selftests: Keep track of memslots more efficiently 2021-05-27 07:45:54 -04:00
s390x KVM: selftests: sync_regs test for diag318 2020-12-10 13:36:05 +01:00
x86_64 KVM: selftests: evmcs_test: Check that VMCS12 is alway properly synced to eVMCS after restore 2021-05-07 06:06:12 -04:00
.gitignore KVM: selftests: add a memslot-related performance benchmark 2021-05-27 07:45:54 -04:00
config selftests: kvm: Adding config fragments 2019-08-09 16:52:38 +02:00
demand_paging_test.c KVM: selftests: Add backing src parameter to dirty_log_perf_test 2021-02-04 05:27:19 -05:00
dirty_log_perf_test.c KVM: selftests: Disable dirty logging with vCPUs running 2021-02-04 05:27:20 -05:00
dirty_log_test.c KVM: selftests: Always run vCPU thread with blocked SIG_IPI 2021-04-21 12:20:02 -04:00
hardware_disable_test.c selftests: kvm: make hardware_disable_test less verbose 2021-03-30 13:07:10 -04:00
kvm_create_max_vcpus.c KVM: selftests: Convert some printf's to pr_info's 2020-03-16 17:57:07 +01:00
kvm_page_table_test.c KVM: selftests: Add a test for kvm page table code 2021-04-20 04:18:53 -04:00
Makefile KVM: selftests: add a memslot-related performance benchmark 2021-05-27 07:45:54 -04:00
memslot_modification_stress_test.c KVM: selftests: Add backing src parameter to dirty_log_perf_test 2021-02-04 05:27:19 -05:00
memslot_perf_test.c KVM: selftests: add a memslot-related performance benchmark 2021-05-27 07:45:54 -04:00
set_memory_region_test.c KVM: selftests: Speed up set_memory_region_test 2021-04-26 12:21:27 -04:00
settings selftests: kvm: Raise the default timeout to 120 seconds 2021-02-09 08:17:08 -05:00
steal_time.c KVM: selftests: Rework timespec functions and usage 2020-03-18 14:08:56 +01:00