diff options
author | 2021-08-04 22:28:42 +0000 | |
---|---|---|
committer | 2021-08-06 07:52:29 -0400 | |
commit | 601f8af01e5ae535b45cdb91234887c9fd861ad4 (patch) | |
tree | b4cba5a72f0b37dcd6ec552c5cf47b3a4018ddbb /tools/testing/selftests/kvm/dirty_log_perf_test.c | |
parent | KVM: x86/mmu: Leverage vcpu->last_used_slot in tdp_mmu_map_handle_target_level (diff) | |
download | linux-dev-601f8af01e5ae535b45cdb91234887c9fd861ad4.tar.xz linux-dev-601f8af01e5ae535b45cdb91234887c9fd861ad4.zip |
KVM: x86/mmu: Leverage vcpu->last_used_slot for rmap_add and rmap_recycle
rmap_add() and rmap_recycle() both run in the context of the vCPU and
thus we can use kvm_vcpu_gfn_to_memslot() to look up the memslot. This
enables rmap_add() and rmap_recycle() to take advantage of
vcpu->last_used_slot and avoid expensive memslot searching.
This change improves the performance of "Populate memory time" in
dirty_log_perf_test with tdp_mmu=N. In addition to improving the
performance, "Populate memory time" no longer scales with the number
of memslots in the VM.
Command | Before | After
------------------------------- | ---------------- | -------------
./dirty_log_perf_test -v64 -x1 | 15.18001570s | 14.99469366s
./dirty_log_perf_test -v64 -x64 | 18.71336392s | 14.98675076s
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: David Matlack <dmatlack@google.com>
Message-Id: <20210804222844.1419481-6-dmatlack@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'tools/testing/selftests/kvm/dirty_log_perf_test.c')
0 files changed, 0 insertions, 0 deletions