[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 13/14] savevm: New save live migration method: p
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH 13/14] savevm: New save live migration method: pending |
Date: |
Fri, 21 Sep 2012 17:11:54 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120911 Thunderbird/15.0.1 |
Il 21/09/2012 16:08, Juan Quintela ha scritto:
> Code just now does (simplified for clarity)
>
> if (qemu_savevm_state_iterate(s->file) == 1) {
> vm_stop_force_state(RUN_STATE_FINISH_MIGRATE);
> qemu_savevm_state_complete(s->file);
> }
>
> Problem here is that qemu_savevm_state_iterate() returns 1 when it
> knows that remaining memory to sent takes less than max downtime.
>
> But this means that we could end spending 2x max_downtime, one
> downtime in qemu_savevm_iterate, and the other in
> qemu_savevm_state_complete.
Technically, the one in qemu_savevm_iterate may not translate into
actual downtime if the guest does not need I/O, as it is "just" stolen
time. But this is just a nit in the commit message. Very good catch!
Another nit:
>
> +uint64_t qemu_savevm_state_pending(QEMUFile *f, uint64_t max_size)
> +{
> + SaveStateEntry *se;
> + uint64_t ret = 0;
> +
> + QTAILQ_FOREACH(se, &savevm_handlers, entry) {
> + if (!se->ops || !se->ops->save_live_pending) {
> + continue;
> + }
> + if (se->ops && se->ops->is_active) {
> + if (!se->ops->is_active(se->opaque)) {
> + continue;
> + }
> + }
> + ret += se->ops->save_live_pending(f, se->opaque, max_size);
> + }
> + return ret;
> +}
Here you may want to pass max_size - ret for the last argument of
se->ops->save_live_pending. But in practice this loop will be executed
exactly once, so:
Reviewed-by: Paolo Bonzini <address@hidden>
Paolo
> Changed code to:
>
> pending_size = qemu_savevm_state_pending(s->file, max_size);
> DPRINTF("pending size %lu max %lu\n", pending_size, max_size);
> if (pending_size >= max_size) {
> ret = qemu_savevm_state_iterate(s->file);
> } else {
> vm_stop_force_state(RUN_STATE_FINISH_MIGRATE);
> qemu_savevm_state_complete(s->file);
> }
>
> So what we do is: at current network speed, we calculate the maximum
> number of bytes we can sent: max_size.
>
> Then we ask every save_live section how much they have pending. If
> they are less than max_size, we move to complete phase, otherwise we
> do an iterate one.
>
> This makes things much simpler, because now individual sections don't
> have to caluclate the bandwidth (it was implossible to do right from
> there).
- Re: [Qemu-devel] [PATCH 02/14] add a version number to ram_list, (continued)
- [Qemu-devel] [PATCH 04/14] buffered_file: Move from using a timer to use a thread, Juan Quintela, 2012/09/21
- [Qemu-devel] [PATCH 05/14] migration: make qemu_fopen_ops_buffered() return void, Juan Quintela, 2012/09/21
- [Qemu-devel] [PATCH 09/14] migration: take finer locking, Juan Quintela, 2012/09/21
- [Qemu-devel] [PATCH 08/14] migration: remove unfreeze logic, Juan Quintela, 2012/09/21
- [Qemu-devel] [PATCH 13/14] savevm: New save live migration method: pending, Juan Quintela, 2012/09/21
- Re: [Qemu-devel] [PATCH 13/14] savevm: New save live migration method: pending,
Paolo Bonzini <=
- [Qemu-devel] [PATCH 14/14] migration: print times for end phase, Juan Quintela, 2012/09/21
- [Qemu-devel] [PATCH 10/14] buffered_file: Unfold the trick to restart generating migration data, Juan Quintela, 2012/09/21
- [Qemu-devel] [PATCH 12/14] buffered_file: unfold buffered_append in buffered_put_buffer, Juan Quintela, 2012/09/21
- [Qemu-devel] [PATCH 06/14] migration: stop all cpus correctly, Juan Quintela, 2012/09/21
- [Qemu-devel] [PATCH 11/14] buffered_file: don't flush on put buffer, Juan Quintela, 2012/09/21