KVM: MMU: fix regression from rework mmu_shrink() code
authorXiaotian Feng <dfeng@redhat.com>
Tue, 24 Aug 2010 02:31:07 +0000 (10:31 +0800)
committerAvi Kivity <avi@redhat.com>
Sun, 24 Oct 2010 08:51:21 +0000 (10:51 +0200)
commit80b63faf028fba79e630d3643b0e615bddf4067b
tree0100096362eac40c2da099ee5dc879daa2504d20
parente4abac67b756680c63af369f053d11991616aeb4
KVM: MMU: fix regression from rework mmu_shrink() code

Latest kvm mmu_shrink code rework makes kernel changes kvm->arch.n_used_mmu_pages/
kvm->arch.n_max_mmu_pages at kvm_mmu_free_page/kvm_mmu_alloc_page, which is called
by kvm_mmu_commit_zap_page. So the kvm->arch.n_used_mmu_pages or
kvm_mmu_available_pages(vcpu->kvm) is unchanged after kvm_mmu_prepare_zap_page(),
This caused kvm_mmu_change_mmu_pages/__kvm_mmu_free_some_pages loops forever.
Moving kvm_mmu_commit_zap_page would make the while loop performs as normal.

Reported-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Xiaotian Feng <dfeng@redhat.com>
Tested-by: Avi Kivity <avi@redhat.com>
Cc: Marcelo Tosatti <mtosatti@redhat.com>
Cc: Dave Hansen <dave@linux.vnet.ibm.com>
Cc: Tim Pepper <lnxninja@linux.vnet.ibm.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
arch/x86/kvm/mmu.c