From: Takuya Yoshikawa Date: Tue, 12 Mar 2013 08:45:30 +0000 (+0900) Subject: KVM: x86: Optimize mmio spte zapping when creating/moving memslot X-Git-Tag: omap-for-v3.10/dt-fixes-for-merge-window~32^2~94 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=982b3394dd23eec6e5a2f7871238435a167b63cc;p=pandora-kernel.git KVM: x86: Optimize mmio spte zapping when creating/moving memslot When we create or move a memory slot, we need to zap mmio sptes. Currently, zap_all() is used for this and this is causing two problems: - extra page faults after zapping mmu pages - long mmu_lock hold time during zapping mmu pages For the latter, Marcelo reported a disastrous mmu_lock hold time during hot-plug, which made the guest unresponsive for a long time. This patch takes a simple way to fix these problems: do not zap mmu pages unless they are marked mmio cached. On our test box, this took only 50us for the 4GB guest and we did not see ms of mmu_lock hold time any more. Note that we still need to do zap_all() for other cases. So another work is also needed: Xiao's work may be the one. Reviewed-by: Marcelo Tosatti Signed-off-by: Takuya Yoshikawa Signed-off-by: Gleb Natapov --- Reading git-diff-tree failed