diff options
author | Gleb Natapov <gleb@redhat.com> | 2013-05-30 20:36:30 -0400 |
---|---|---|
committer | Gleb Natapov <gleb@redhat.com> | 2013-06-05 05:34:02 -0400 |
commit | 05988d728dcd962d50374e4e63171324163005b6 (patch) | |
tree | d9839cdbd1514e367d5d6e073d8b80c25f87fc0c /arch/x86/kvm/mmu.c | |
parent | 365c886860c4ba670d245e762b23987c912c129a (diff) |
KVM: MMU: reduce KVM_REQ_MMU_RELOAD when root page is zapped
Quote Gleb's mail:
| why don't we check for sp->role.invalid in
| kvm_mmu_prepare_zap_page before calling kvm_reload_remote_mmus()?
and
| Actually we can add check for is_obsolete_sp() there too since
| kvm_mmu_invalidate_all_pages() already calls kvm_reload_remote_mmus()
| after incrementing mmu_valid_gen.
[ Xiao: add some comments and the check of is_obsolete_sp() ]
Signed-off-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>
Reviewed-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Gleb Natapov <gleb@redhat.com>
Diffstat (limited to 'arch/x86/kvm/mmu.c')
-rw-r--r-- | arch/x86/kvm/mmu.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index 79af88ab2f1d..6941fa74eb35 100644 --- a/arch/x86/kvm/mmu.c +++ b/arch/x86/kvm/mmu.c | |||
@@ -2108,7 +2108,13 @@ static int kvm_mmu_prepare_zap_page(struct kvm *kvm, struct kvm_mmu_page *sp, | |||
2108 | kvm_mod_used_mmu_pages(kvm, -1); | 2108 | kvm_mod_used_mmu_pages(kvm, -1); |
2109 | } else { | 2109 | } else { |
2110 | list_move(&sp->link, &kvm->arch.active_mmu_pages); | 2110 | list_move(&sp->link, &kvm->arch.active_mmu_pages); |
2111 | kvm_reload_remote_mmus(kvm); | 2111 | |
2112 | /* | ||
2113 | * The obsolete pages can not be used on any vcpus. | ||
2114 | * See the comments in kvm_mmu_invalidate_zap_all_pages(). | ||
2115 | */ | ||
2116 | if (!sp->role.invalid && !is_obsolete_sp(kvm, sp)) | ||
2117 | kvm_reload_remote_mmus(kvm); | ||
2112 | } | 2118 | } |
2113 | 2119 | ||
2114 | sp->role.invalid = 1; | 2120 | sp->role.invalid = 1; |