The implementation of the current virtio-balloon is not very efficient, bellow is test result of time spends on inflating the balloon to 3GB of a 4GB idle guest: a. allocating pages (6.5%, 103ms) b. sending PFNs to host (68.3%, 787ms) c. address translation (6.1%, 96ms) d. madvise (19%, 300ms) It takes about 1577ms for the whole inflating process to complete. The test shows that the bottle neck is the stage b and stage d. If using a bitmap to send the page info instead of the PFNs, we can reduce the overhead in stage b quite a lot. Furthermore, it's possible to do the address translation and the madvise with a bulk of pages, instead of the current page per page way, so the overhead of stage c and stage d can also be reduced a lot. In addition, we can speed up live migration by skipping process guest's free pages. Patch 1 and patch 2 are the kernel side implementation which are intended to speed up the inflating & deflating process by adding a new feature to the virtio-balloon device. And now, inflating the balloon to 3GB of a 4GB idle guest only takes 200ms, it's about 8 times as fast as before. Patch 3 and patch 4 add the cache drop support, now hypervisor can request the guest to drop it's cache. It's useful before inflating the virtio-balloon and before starting live migration. Patch 5 and patch 6 save guest's free page information into a page bitmap and send the bitmap to host through balloon's virt queue. Liang Li (6): virtio-balloon: rework deflate to add page to a list virtio-balloon: speed up inflate/deflate process mm:split the drop cache operation into a function virtio-balloon: add drop cache support mm: add the related functions to get free page info virtio-balloon: tell host vm's free page info drivers/virtio/virtio_balloon.c | 321 +++++++++++++++++++++++++++++++----- fs/drop_caches.c | 22 ++- include/linux/mm.h | 1 + include/uapi/linux/virtio_balloon.h | 2 + mm/page_alloc.c | 40 +++++ 5 files changed, 339 insertions(+), 47 deletions(-) -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html