]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: MMU: Don't use RCU for lockless shadow walking
authorAvi Kivity <avi@redhat.com>
Mon, 14 May 2012 12:44:06 +0000 (15:44 +0300)
committerMarcelo Tosatti <mtosatti@redhat.com>
Wed, 16 May 2012 19:08:28 +0000 (16:08 -0300)
commitca4b8e69c4131d441d6f66018c98ae3a7aa12510
tree80e5e37a29ae247d6223672126a10c15751f4dc7
parentaaabbb09c75a97f3ad16f1157d818b933c9b3f38
KVM: MMU: Don't use RCU for lockless shadow walking

Using RCU for lockless shadow walking can increase the amount of memory
in use by the system, since RCU grace periods are unpredictable.  We also
have an unconditional write to a shared variable (reader_counter), which
isn't good for scaling.

Replace that with a scheme similar to x86's get_user_pages_fast(): disable
interrupts during lockless shadow walk to force the freer
(kvm_mmu_commit_zap_page()) to wait for the TLB flush IPI to find the
processor with interrupts enabled.

We also add a new vcpu->mode, READING_SHADOW_PAGE_TABLES, to prevent
kvm_flush_remote_tlbs() from avoiding the IPI.

Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
arch/x86/include/asm/kvm_host.h
arch/x86/kvm/mmu.c
include/linux/kvm_host.h