From: Takuya Yoshikawa Date: Mon, 2 Jul 2012 08:59:33 +0000 (+0900) Subject: KVM: MMU: Avoid handling same rmap_pde in kvm_handle_hva_range() X-Git-Tag: omap-for-v3.7-rc1/fixes-cpufreq-signed~15^2~101^2~17 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bcd3ef58283a471d6b65855b83f78bd39eb55391;p=pandora-kernel.git KVM: MMU: Avoid handling same rmap_pde in kvm_handle_hva_range() When we invalidate a THP page, we call the handler with the same rmap_pde argument 512 times in the following loop: for each guest page in the range for each level unmap using rmap This patch avoids these extra handler calls by changing the loop order like this: for each level for each rmap in the range unmap using rmap With the preceding patches in the patch series, this made THP page invalidation more than 5 times faster on our x86 host: the host became more responsive during swapping the guest's memory as a result. Signed-off-by: Takuya Yoshikawa Signed-off-by: Marcelo Tosatti --- Reading git-diff-tree failed