qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: bala24@linux.vnet.ibm.com
To: qemu-devel@nongnu.org
Cc: david@gibson.dropbear.id.au, dgilbert@redhat.com,
	peterx@redhat.com, Balamuruhan S <bala24@linux.vnet.ibm.com>,
	Juan Quintela <quintela@redhat.com>
Subject: [Qemu-devel] [PATCH 1/1] migration: calculate expected_downtime considering redirtied ram
Date: Tue, 22 Jan 2019 20:35:43 +0530	[thread overview]
Message-ID: <20190122150543.16889-2-bala24@linux.vnet.ibm.com> (raw)
In-Reply-To: <20190122150543.16889-1-bala24@linux.vnet.ibm.com>

From: Balamuruhan S <bala24@linux.vnet.ibm.com>

currently we calculate expected_downtime by time taken to transfer
remaining ram, but during the time we had transferred remaining ram
few pages of ram might be redirtied and we need to retransfer it,
so it is better to consider them for calculating expected_downtime
for getting more accurate values.

Total ram to be transferred = remaining ram + (redirtied ram at the
                                               time when the remaining
                                               ram gets transferred)

redirtied ram = dirty_pages_rate * time taken to transfer remaining ram

redirtied ram = dirty_pages_rate * (remaining ram / bandwidth)

expected_downtime = (remaining ram + redirtied ram) / bandwidth

Suggested-by: David Gibson <david@gibson.dropbear.id.au>
Suggested-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Balamuruhan S <bala24@linux.vnet.ibm.com>
---
 migration/migration.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/migration/migration.c b/migration/migration.c
index ffc4d9e556..dc38e9a380 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -2903,7 +2903,13 @@ static void migration_update_counters(MigrationState *s,
      * recalculate. 10000 is a small enough number for our purposes
      */
     if (ram_counters.dirty_pages_rate && transferred > 10000) {
-        s->expected_downtime = ram_counters.remaining / bandwidth;
+        /* Time required to transfer remaining ram */
+        remaining_ram_transfer_time = ram_counters.remaining / bandwidth
+
+        /* redirty of ram at the time remaining ram gets transferred*/
+        newly_dirtied_ram = ram_counters.dirty_pages_rate * remaining_ram_transfer_time
+
+        s->expected_downtime = (ram_counters.remaining + newly_dirtied_ram) / bandwidth;
     }
 
     qemu_file_reset_rate_limit(s->to_dst_file);
-- 
2.14.5

  reply	other threads:[~2019-01-22 18:47 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-22 15:05 [Qemu-devel] [PATCH 0/1] migration: calculate expected_downtime considering redirtied ram bala24
2019-01-22 15:05 ` bala24 [this message]
2019-01-23 16:35   ` [Qemu-devel] [PATCH 1/1] " Juan Quintela
2019-01-24  7:18     ` Peter Xu
2019-01-30  9:16       ` Balamuruhan S
2019-02-02 22:05 ` [Qemu-devel] [PATCH 0/1] " no-reply

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=20190122150543.16889-2-bala24@linux.vnet.ibm.com \
    --to=bala24@linux.vnet.ibm.com \
    --cc=david@gibson.dropbear.id.au \
    --cc=dgilbert@redhat.com \
    --cc=peterx@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.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).