qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Denis V. Lunev" <den@openvz.org>
Cc: Amit Shah <amit.shah@redhat.com>,
	Igor Redko <redkoi@virtuozzo.com>,
	Juan Quintela <quintela@redhat.com>,
	qemu-devel@nongnu.org, "Denis V. Lunev" <den@openvz.org>
Subject: [Qemu-devel] [PATCH 1/1] migration: fix expected_downtime
Date: Thu, 24 Sep 2015 17:07:04 +0300	[thread overview]
Message-ID: <1443103624-17230-1-git-send-email-den@openvz.org> (raw)

From: Igor Redko <redkoi@virtuozzo.com>

To get this estimation we must divide pending_size by bandwidth
according to description of expected-downtime ("qmp-commands.hx:3246"):
  "expected-downtime": only present while migration is active
              total amount in ms for downtime that was calculated on
              the last bitmap round (json-int)

Previous version was just wrong because dirty_bytes_rate and bandwidth
are measured in Bytes/ms, so dividing first by second we get some
dimensionless quantity.
As it said in description above this value is showed during active
migration phase and recalculated only after transferring all memory
and if this process took more than 1 sec. So maybe just nobody noticed
that bug.

Signed-off-by: Igor Redko <redkoi@virtuozzo.com>
Reviewed-by: Anna Melekhova <annam@virtuozzo.com>
Signed-off-by: Denis V. Lunev <den@openvz.org>
CC: Juan Quintela <quintela@redhat.com>
CC: Amit Shah <amit.shah@redhat.com>
---
 migration/migration.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/migration/migration.c b/migration/migration.c
index 662e77e..d55d545 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -994,7 +994,7 @@ static void *migration_thread(void *opaque)
             /* if we haven't sent anything, we don't want to recalculate
                10000 is a small enough number for our purposes */
             if (s->dirty_bytes_rate && transferred_bytes > 10000) {
-                s->expected_downtime = s->dirty_bytes_rate / bandwidth;
+                s->expected_downtime = pending_size / bandwidth;
             }
 
             qemu_file_reset_rate_limit(s->file);
-- 
2.1.4

             reply	other threads:[~2015-09-24 14:07 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-24 14:07 Denis V. Lunev [this message]
2015-09-28 19:22 ` [Qemu-devel] [PATCH 1/1] migration: fix expected_downtime Dr. David Alan Gilbert
2015-10-01  8:31   ` Igor Redko
2015-10-01 14:33   ` Igor Redko
2015-10-07 10:56     ` Dr. David Alan Gilbert
2015-10-09  9:08       ` Juan Quintela

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1443103624-17230-1-git-send-email-den@openvz.org \
    --to=den@openvz.org \
    --cc=amit.shah@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    --cc=redkoi@virtuozzo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).