]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
KVM: X86: Optimize zapping rmap
authorPeter Xu <peterx@redhat.com>
Fri, 30 Jul 2021 22:06:05 +0000 (18:06 -0400)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 4 Aug 2021 09:55:56 +0000 (05:55 -0400)
commita75b540451d20ef1aebaa09d183ddc5c44c6f86a
tree360879500a6da4239f9f03dcfb6ef70a5834b1b3
parent13236e25ebab91b3e42ddedf5354b569ace1b555
KVM: X86: Optimize zapping rmap

Using rmap_get_first() and rmap_remove() for zapping a huge rmap list could be
slow.  The easy way is to travers the rmap list, collecting the a/d bits and
free the slots along the way.

Provide a pte_list_destroy() and do exactly that.

Signed-off-by: Peter Xu <peterx@redhat.com>
Message-Id: <20210730220605.26377-1-peterx@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/mmu/mmu.c