• Xiao Guangrong's avatar
    KVM: MMU: collapse TLB flushes when zap all pages · f34d251d
    Xiao Guangrong authored
    kvm_zap_obsolete_pages uses lock-break technique to zap pages,
    it will flush tlb every time when it does lock-break
    
    We can reload mmu on all vcpus after updating the generation
    number so that the obsolete pages are not used on any vcpus,
    after that we do not need to flush tlb when obsolete pages
    are zapped
    
    It will do kvm_mmu_prepare_zap_page many times and use one
    kvm_mmu_commit_zap_page to collapse tlb flush, the side-effects
    is that causes obsolete pages unlinked from active_list but leave
    on hash-list, so we add the comment around the hash list walker
    
    Note: kvm_mmu_commit_zap_page is still needed before free
    the pages since other vcpus may be doing locklessly shadow
    page walking
    Signed-off-by: default avatarXiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>
    Reviewed-by: default avatarMarcelo Tosatti <mtosatti@redhat.com>
    Signed-off-by: default avatarGleb Natapov <gleb@redhat.com>
    f34d251d
mmu.c 107 KB