[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC qemu 4/4] migration: filter out guest's free pages
From: |
Daniel P. Berrange |
Subject: |
Re: [Qemu-devel] [RFC qemu 4/4] migration: filter out guest's free pages in ram bulk stage |
Date: |
Thu, 3 Mar 2016 12:45:20 +0000 |
User-agent: |
Mutt/1.5.24 (2015-08-30) |
On Thu, Mar 03, 2016 at 06:44:28PM +0800, Liang Li wrote:
> Get the free pages information through virtio and filter out the free
> pages in the ram bulk stage. This can significantly reduce the total
> live migration time as well as network traffic.
>
> Signed-off-by: Liang Li <address@hidden>
> ---
> migration/ram.c | 52 ++++++++++++++++++++++++++++++++++++++++++++++------
> 1 file changed, 46 insertions(+), 6 deletions(-)
> @@ -1945,6 +1971,20 @@ static int ram_save_setup(QEMUFile *f, void *opaque)
> DIRTY_MEMORY_MIGRATION);
> }
> memory_global_dirty_log_start();
> +
> + if (balloon_free_pages_support() &&
> + balloon_get_free_pages(migration_bitmap_rcu->free_pages_bmap,
> + &free_pages_count) == 0) {
> + qemu_mutex_unlock_iothread();
> + while (balloon_get_free_pages(migration_bitmap_rcu->free_pages_bmap,
> + &free_pages_count) == 0) {
> + usleep(1000);
> + }
> + qemu_mutex_lock_iothread();
> +
> + filter_out_guest_free_pages(migration_bitmap_rcu->free_pages_bmap);
> + }
IIUC, this code is synchronous wrt to the guest OS balloon drive. ie it
is asking the geust for free pages and waiting for a response. If the
guest OS has crashed this is going to mean QEMU waits forever and thus
migration won't complete. Similarly you need to consider that the guest
OS may be malicious and simply never respond.
So if the migration code is going to use the guest balloon driver to get
info about free pages it has to be done in an asynchronous manner so that
migration can never be stalled by a slow/crashed/malicious guest driver.
Regards,
Daniel
--
|: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org -o- http://virt-manager.org :|
|: http://autobuild.org -o- http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|
- [Qemu-devel] [RFC qemu 1/4] pc: Add code to get the lowmem form PCMachineState, (continued)
- [Qemu-devel] [RFC qemu 1/4] pc: Add code to get the lowmem form PCMachineState, Liang Li, 2016/03/03
- [Qemu-devel] [RFC qemu 3/4] migration: not set migration bitmap in setup stage, Liang Li, 2016/03/03
- [Qemu-devel] [RFC qemu 2/4] virtio-balloon: Add a new feature to balloon device, Liang Li, 2016/03/03
- [Qemu-devel] [RFC qemu 4/4] migration: filter out guest's free pages in ram bulk stage, Liang Li, 2016/03/03
- Re: [Qemu-devel] [RFC qemu 0/4] A PV solution for live migration optimization, Roman Kagan, 2016/03/03
- Re: [Qemu-devel] [RFC qemu 0/4] A PV solution for live migration optimization, Dr. David Alan Gilbert, 2016/03/03
- Re: [Qemu-devel] [RFC qemu 0/4] A PV solution for live migration optimization, Li, Liang Z, 2016/03/03
- Re: [Qemu-devel] [RFC qemu 0/4] A PV solution for live migration optimization, Roman Kagan, 2016/03/04
- Re: [Qemu-devel] [RFC qemu 0/4] A PV solution for live migration optimization, Li, Liang Z, 2016/03/04
- Re: [Qemu-devel] [RFC qemu 0/4] A PV solution for live migration optimization, Roman Kagan, 2016/03/04
- Re: [Qemu-devel] [RFC qemu 0/4] A PV solution for live migration optimization, Li, Liang Z, 2016/03/04
- Re: [Qemu-devel] [RFC qemu 0/4] A PV solution for live migration optimization, Michael S. Tsirkin, 2016/03/04