]> git.baikalelectronics.ru Git - kernel.git/commit
kvm: mmu: lazy collapse small sptes into large sptes
authorWanpeng Li <wanpeng.li@linux.intel.com>
Fri, 3 Apr 2015 07:40:25 +0000 (15:40 +0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 8 Apr 2015 08:47:04 +0000 (10:47 +0200)
commite5acdd07ae0a132a38299c4e1d2524b32aa53b82
tree64029d66d8a1179310bd61b1dadc9ae7dca2d93c
parent4a50f2b57dde49e773dfbef87bce97eb70c5c8ef
kvm: mmu: lazy collapse small sptes into large sptes

Dirty logging tracks sptes in 4k granularity, meaning that large sptes
have to be split.  If live migration is successful, the guest in the
source machine will be destroyed and large sptes will be created in the
destination. However, the guest continues to run in the source machine
(for example if live migration fails), small sptes will remain around
and cause bad performance.

This patch introduce lazy collapsing of small sptes into large sptes.
The rmap will be scanned in ioctl context when dirty logging is stopped,
dropping those sptes which can be collapsed into a single large-page spte.
Later page faults will create the large-page sptes.

Reviewed-by: Xiao Guangrong <guangrong.xiao@linux.intel.com>
Signed-off-by: Wanpeng Li <wanpeng.li@linux.intel.com>
Message-Id: <1428046825-6905-1-git-send-email-wanpeng.li@linux.intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/include/asm/kvm_host.h
arch/x86/kvm/mmu.c
arch/x86/kvm/x86.c