]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: x86/mmu: Consider the hva in mmu_notifier retry
authorDavid Stevens <stevensd@chromium.org>
Mon, 22 Feb 2021 02:45:22 +0000 (11:45 +0900)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 22 Feb 2021 18:16:53 +0000 (13:16 -0500)
commitfb337b647108a24ffd98a3d1ff457a4607fb4ac0
tree412833df3e6c6732c6ea1e86d0f3b47c33f79e18
parentd13a97489035afe4ac6a9281e10cae8d2ac0aeab
KVM: x86/mmu: Consider the hva in mmu_notifier retry

Track the range being invalidated by mmu_notifier and skip page fault
retries if the fault address is not affected by the in-progress
invalidation. Handle concurrent invalidations by finding the minimal
range which includes all ranges being invalidated. Although the combined
range may include unrelated addresses and cannot be shrunk as individual
invalidation operations complete, it is unlikely the marginal gains of
proper range tracking are worth the additional complexity.

The primary benefit of this change is the reduction in the likelihood of
extreme latency when handing a page fault due to another thread having
been preempted while modifying host virtual addresses.

Signed-off-by: David Stevens <stevensd@chromium.org>
Message-Id: <20210222024522.1751719-3-stevensd@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/powerpc/kvm/book3s_64_mmu_hv.c
arch/powerpc/kvm/book3s_64_mmu_radix.c
arch/x86/kvm/mmu/mmu.c
arch/x86/kvm/mmu/paging_tmpl.h
include/linux/kvm_host.h
virt/kvm/kvm_main.c