KVM: x86/mmu: Optimize kvm_zap_obsolete_pages execution time
PATCH v2 1/1 KVM: x86/mmu: Optimize kvm_zap_obsolete_pages execution time
From: Peng Hao <[email protected]>
Optimize function execution by checking whether the active_mmu_pages list is empty.
Signed-off-by Peng Hao <[email protected]>
--- arch/x86/kvm/mmu/mmu.c | 3 +++ 1 file changed, 3 insertions(+)
arch/x86/kvm/mmu/mmu.c +3 -0
@@ -6353,6 +6353,9 @@ static void kvm_zap_obsolete_pages(struct kvm *kvm)int nr_zapped, batch =0 ;bool unstable; +if (list_empty (&kvm->arch.active_mmu_pages)) +return ; + restart:list_for_each_entry_safe_reverse (sp, node, &kvm->arch.active_mmu_pages, link) {
Signature · 1 line
2.27.0