All of lore.kernel.org
 help / color / mirror / Atom feed
From: Juan Quintela <quintela@redhat.com>
To: qemu-devel@nongnu.org
Cc: dgilbert@redhat.com, lvivier@redhat.com, peterx@redhat.com
Subject: [Qemu-devel] [PATCH 3/5] migration: Print statistics about the number of remaining target pages
Date: Fri,  2 Jun 2017 00:08:11 +0200	[thread overview]
Message-ID: <20170601220813.30535-4-quintela@redhat.com> (raw)
In-Reply-To: <20170601220813.30535-1-quintela@redhat.com>

Signed-off-by: Juan Quintela <quintela@redhat.com>
---
 migration/migration.c | 4 +++-
 migration/ram.c       | 4 ++--
 migration/ram.h       | 2 +-
 qapi-schema.json      | 6 +++++-
 4 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/migration/migration.c b/migration/migration.c
index ea3d41c..2c13217 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -518,7 +518,9 @@ static void populate_ram_info(MigrationInfo *info, MigrationState *s)
     }
 
     if (s->state != MIGRATION_STATUS_COMPLETED) {
-        info->ram->remaining = ram_bytes_remaining();
+        info->ram->remaining_pages = ram_pages_remaining();
+        info->ram->remaining = ram_pages_remaining() *
+            qemu_target_page_size();
         info->ram->dirty_pages_rate = ram_dirty_pages_rate();
     }
 }
diff --git a/migration/ram.c b/migration/ram.c
index 04b55a7..30519e1 100644
--- a/migration/ram.c
+++ b/migration/ram.c
@@ -265,9 +265,9 @@ uint64_t ram_bytes_transferred(void)
     return ram_state.bytes_transferred;
 }
 
-uint64_t ram_bytes_remaining(void)
+uint64_t ram_pages_remaining(void)
 {
-    return ram_state.migration_dirty_pages * TARGET_PAGE_SIZE;
+    return ram_state.migration_dirty_pages;
 }
 
 uint64_t ram_dirty_sync_count(void)
diff --git a/migration/ram.h b/migration/ram.h
index d4da419..5864470 100644
--- a/migration/ram.h
+++ b/migration/ram.h
@@ -41,7 +41,7 @@ uint64_t xbzrle_mig_pages_cache_miss(void);
 double xbzrle_mig_cache_miss_rate(void);
 uint64_t xbzrle_mig_pages_overflow(void);
 uint64_t ram_bytes_transferred(void);
-uint64_t ram_bytes_remaining(void);
+uint64_t ram_pages_remaining(void);
 uint64_t ram_dirty_sync_count(void);
 uint64_t ram_dirty_pages_rate(void);
 uint64_t ram_postcopy_requests(void);
diff --git a/qapi-schema.json b/qapi-schema.json
index 4b50b65..ff1c048 100644
--- a/qapi-schema.json
+++ b/qapi-schema.json
@@ -601,6 +601,9 @@
 # @page-size: The number of bytes per page for the various page-based
 #        statistics (since 2.10)
 #
+# @remaining-pages: amount of pages remaining to be transferred to the target VM
+#        (since 2.10)
+#
 # Since: 0.14.0
 ##
 { 'struct': 'MigrationStats',
@@ -608,7 +611,8 @@
            'duplicate': 'int', 'skipped': 'int', 'normal': 'int',
            'normal-bytes': 'int', 'dirty-pages-rate' : 'int',
            'mbps' : 'number', 'dirty-sync-count' : 'int',
-           'postcopy-requests' : 'int', 'page-size' : 'int' } }
+           'postcopy-requests' : 'int', 'page-size' : 'int',
+           'remaining-pages' : 'int' } }
 
 ##
 # @XBZRLECacheStats:
-- 
2.9.4

  parent reply	other threads:[~2017-06-01 22:08 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-01 22:08 [Qemu-devel] [PATCH 0/5] Make RAMState dynamic Juan Quintela
2017-06-01 22:08 ` [Qemu-devel] [PATCH 1/5] ram: Call migration_page_queue_free() at ram_migration_cleanup() Juan Quintela
2017-06-05 11:24   ` Dr. David Alan Gilbert
2017-06-06  7:58   ` Peter Xu
2017-06-01 22:08 ` [Qemu-devel] [PATCH 2/5] ram: Move ZERO_TARGET_PAGE inside XBZRLE Juan Quintela
2017-06-05 11:27   ` Dr. David Alan Gilbert
2017-06-06  7:59   ` Peter Xu
2017-06-01 22:08 ` Juan Quintela [this message]
2017-06-02 15:15   ` [Qemu-devel] [PATCH 3/5] migration: Print statistics about the number of remaining target pages Eric Blake
2017-06-02 16:36     ` Juan Quintela
2017-06-06 17:48     ` Juan Quintela
2017-06-01 22:08 ` [Qemu-devel] [PATCH 4/5] ram: Use MigrationStats for statistics Juan Quintela
2017-06-05 12:34   ` Dr. David Alan Gilbert
2017-06-06  8:05     ` Peter Xu
2017-06-06 17:33       ` Juan Quintela
2017-06-07  3:08         ` Peter Xu
2017-06-01 22:08 ` [Qemu-devel] [PATCH 5/5] ram: Make RAMState dynamic Juan Quintela
2017-06-05 15:00   ` Dr. David Alan Gilbert
2017-06-06  8:16   ` Peter Xu
2017-06-06 17:39     ` 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=20170601220813.30535-4-quintela@redhat.com \
    --to=quintela@redhat.com \
    --cc=dgilbert@redhat.com \
    --cc=lvivier@redhat.com \
    --cc=peterx@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.