KVM: sort memslots by its size and use line search
authorXiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>
Thu, 24 Nov 2011 09:40:57 +0000 (17:40 +0800)
committerAvi Kivity <avi@redhat.com>
Tue, 27 Dec 2011 09:17:40 +0000 (11:17 +0200)
commitbf3e05bc1e2781d5d8d3ddb2d8bf2d6ec207e5cb
tree7312367143f00ec1c051831f3a4e6dcc7f8acd92
parent28a37544fb0223eb9805d2567b88f7360edec52a
KVM: sort memslots by its size and use line search

Sort memslots base on its size and use line search to find it, so that the
larger memslots have better fit

The idea is from Avi

Signed-off-by: Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
include/linux/kvm_host.h
virt/kvm/kvm_main.c