diff options
author | Avi Kivity <avi@redhat.com> | 2012-05-14 08:44:06 -0400 |
---|---|---|
committer | Marcelo Tosatti <mtosatti@redhat.com> | 2012-05-16 15:08:28 -0400 |
commit | c142786c6291189b5c85f53d91743e1eefbd8fe0 (patch) | |
tree | 80e5e37a29ae247d6223672126a10c15751f4dc7 /include/linux/kvm_host.h | |
parent | b2da15ac26a0c00fc0d399a2bc5cf3c4e15f0b4f (diff) |
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>
Diffstat (limited to 'include/linux/kvm_host.h')
-rw-r--r-- | include/linux/kvm_host.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index cae342d29d1b..c4464356b35b 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h | |||
@@ -128,7 +128,8 @@ int kvm_async_pf_wakeup_all(struct kvm_vcpu *vcpu); | |||
128 | enum { | 128 | enum { |
129 | OUTSIDE_GUEST_MODE, | 129 | OUTSIDE_GUEST_MODE, |
130 | IN_GUEST_MODE, | 130 | IN_GUEST_MODE, |
131 | EXITING_GUEST_MODE | 131 | EXITING_GUEST_MODE, |
132 | READING_SHADOW_PAGE_TABLES, | ||
132 | }; | 133 | }; |
133 | 134 | ||
134 | /* | 135 | /* |