* [Qemu-devel] [PATCH v2] Add page-size to output in 'info migrate'
@ 2017-03-21 2:22 Chao Fan
2017-03-21 8:22 ` Juan Quintela
0 siblings, 1 reply; 3+ messages in thread
From: Chao Fan @ 2017-03-21 2:22 UTC (permalink / raw)
To: qemu-devel, dgilbert, quintela, eblake, armbru, berrange
Cc: caoj.fnst, douly.fnst, maozy.fnst, Chao Fan, Li Zhijian
The number of dirty pages outputed in 'pages' in the command
'info migrate', so add page-size to calculate the number of dirty
pages in bytes.
Signed-off-by: Chao Fan <fanc.fnst@cn.fujitsu.com>
Signed-off-by: Li Zhijian <lizhijian@cn.fujitsu.com>
---
v2: fix the grammar in qapi-schema.json [Eric Blake]
---
hmp.c | 3 +++
include/migration/migration.h | 1 +
migration/migration.c | 2 ++
migration/ram.c | 2 ++
qapi-schema.json | 5 ++++-
5 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/hmp.c b/hmp.c
index edb8970..be75e71 100644
--- a/hmp.c
+++ b/hmp.c
@@ -215,6 +215,9 @@ void hmp_info_migrate(Monitor *mon, const QDict *qdict)
info->ram->normal_bytes >> 10);
monitor_printf(mon, "dirty sync count: %" PRIu64 "\n",
info->ram->dirty_sync_count);
+ monitor_printf(mon, "page size: %" PRIu64 " kbytes\n",
+ info->ram->page_size >> 10);
+
if (info->ram->dirty_pages_rate) {
monitor_printf(mon, "dirty pages rate: %" PRIu64 " pages\n",
info->ram->dirty_pages_rate);
diff --git a/include/migration/migration.h b/include/migration/migration.h
index 5720c88..9fffe73 100644
--- a/include/migration/migration.h
+++ b/include/migration/migration.h
@@ -172,6 +172,7 @@ struct MigrationState
int64_t xbzrle_cache_size;
int64_t setup_time;
int64_t dirty_sync_count;
+ int64_t page_size;
/* Count of requests incoming from destination */
int64_t postcopy_requests;
diff --git a/migration/migration.c b/migration/migration.c
index 3dab684..a1cb123 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -645,6 +645,7 @@ static void populate_ram_info(MigrationInfo *info, MigrationState *s)
info->ram->mbps = s->mbps;
info->ram->dirty_sync_count = s->dirty_sync_count;
info->ram->postcopy_requests = s->postcopy_requests;
+ info->ram->page_size = s->page_size;
if (s->state != MIGRATION_STATUS_COMPLETED) {
info->ram->remaining = ram_bytes_remaining();
@@ -1115,6 +1116,7 @@ MigrationState *migrate_init(const MigrationParams *params)
s->last_req_rb = NULL;
error_free(s->error);
s->error = NULL;
+ s->page_size = 0;
migrate_set_state(&s->state, MIGRATION_STATUS_NONE, MIGRATION_STATUS_SETUP);
diff --git a/migration/ram.c b/migration/ram.c
index 719425b..028cc4c 100644
--- a/migration/ram.c
+++ b/migration/ram.c
@@ -1998,7 +1998,9 @@ static int ram_save_init_globals(void)
static int ram_save_setup(QEMUFile *f, void *opaque)
{
RAMBlock *block;
+ MigrationState *s = migrate_get_current();
+ s->page_size = TARGET_PAGE_SIZE;
/* migration has already setup the bitmap, reuse it. */
if (!migration_in_colo_state()) {
if (ram_save_init_globals() < 0) {
diff --git a/qapi-schema.json b/qapi-schema.json
index 32b4a4b..5a0e425 100644
--- a/qapi-schema.json
+++ b/qapi-schema.json
@@ -575,6 +575,9 @@
# @postcopy-requests: The number of page requests received from the destination
# (since 2.7)
#
+# @page-size: The number of bytes per page for the various page-based
+# statistics (since 2.10)
+#
# Since: 0.14.0
##
{ 'struct': 'MigrationStats',
@@ -582,7 +585,7 @@
'duplicate': 'int', 'skipped': 'int', 'normal': 'int',
'normal-bytes': 'int', 'dirty-pages-rate' : 'int',
'mbps' : 'number', 'dirty-sync-count' : 'int',
- 'postcopy-requests' : 'int' } }
+ 'postcopy-requests' : 'int', 'page-size' : 'int' } }
##
# @XBZRLECacheStats:
--
2.9.3
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH v2] Add page-size to output in 'info migrate'
2017-03-21 2:22 [Qemu-devel] [PATCH v2] Add page-size to output in 'info migrate' Chao Fan
@ 2017-03-21 8:22 ` Juan Quintela
2017-03-21 8:52 ` Chao Fan
0 siblings, 1 reply; 3+ messages in thread
From: Juan Quintela @ 2017-03-21 8:22 UTC (permalink / raw)
To: Chao Fan
Cc: qemu-devel, dgilbert, eblake, armbru, berrange, caoj.fnst,
douly.fnst, maozy.fnst, Li Zhijian
Chao Fan <fanc.fnst@cn.fujitsu.com> wrote:
> The number of dirty pages outputed in 'pages' in the command
> 'info migrate', so add page-size to calculate the number of dirty
> pages in bytes.
>
> Signed-off-by: Chao Fan <fanc.fnst@cn.fujitsu.com>
> Signed-off-by: Li Zhijian <lizhijian@cn.fujitsu.com>
>
> ---
> v2: fix the grammar in qapi-schema.json [Eric Blake]
Hi
If you see my RAMState series, you can see that things have moved a lot
here, I added this to my current series:
(there is a rename of qemu_target_page_bits() to qemu_target_page_size()
in the series).
If you like it, I can leave it that way there.
Thanks, Juan.
commit 1944568bd8cdf912b3bf231bbc3c66071fde9f58
Author: Chao Fan <fanc.fnst@cn.fujitsu.com>
Date: Tue Mar 21 10:22:43 2017 +0800
Add page-size to output in 'info migrate'
The number of dirty pages outputed in 'pages' in the command
'info migrate', so add page-size to calculate the number of dirty
pages in bytes.
Signed-off-by: Chao Fan <fanc.fnst@cn.fujitsu.com>
Signed-off-by: Li Zhijian <lizhijian@cn.fujitsu.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
diff --git a/hmp.c b/hmp.c
index edb8970..be75e71 100644
--- a/hmp.c
+++ b/hmp.c
@@ -215,6 +215,9 @@ void hmp_info_migrate(Monitor *mon, const QDict *qdict)
info->ram->normal_bytes >> 10);
monitor_printf(mon, "dirty sync count: %" PRIu64 "\n",
info->ram->dirty_sync_count);
+ monitor_printf(mon, "page size: %" PRIu64 " kbytes\n",
+ info->ram->page_size >> 10);
+
if (info->ram->dirty_pages_rate) {
monitor_printf(mon, "dirty pages rate: %" PRIu64 " pages\n",
info->ram->dirty_pages_rate);
diff --git a/migration/migration.c b/migration/migration.c
index 92c3c6b..fc19ba7 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -650,6 +650,7 @@ static void populate_ram_info(MigrationInfo *info, MigrationState *s)
info->ram->mbps = s->mbps;
info->ram->dirty_sync_count = ram_dirty_sync_count();
info->ram->postcopy_requests = ram_postcopy_requests();
+ info->ram->page_size = qemu_target_page_size();
if (s->state != MIGRATION_STATUS_COMPLETED) {
info->ram->remaining = ram_bytes_remaining();
diff --git a/qapi-schema.json b/qapi-schema.json
index 68a4327..c7ec62c 100644
--- a/qapi-schema.json
+++ b/qapi-schema.json
@@ -598,6 +598,9 @@
# @postcopy-requests: The number of page requests received from the destination
# (since 2.7)
#
+# @page-size: The number of bytes per page for the various page-based
+# statistics (since 2.10)
+#
# Since: 0.14.0
##
{ 'struct': 'MigrationStats',
@@ -605,7 +608,7 @@
'duplicate': 'int', 'skipped': 'int', 'normal': 'int',
'normal-bytes': 'int', 'dirty-pages-rate' : 'int',
'mbps' : 'number', 'dirty-sync-count' : 'int',
- 'postcopy-requests' : 'int' } }
+ 'postcopy-requests' : 'int', 'page-size' : 'int' } }
##
# @XBZRLECacheStats:
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH v2] Add page-size to output in 'info migrate'
2017-03-21 8:22 ` Juan Quintela
@ 2017-03-21 8:52 ` Chao Fan
0 siblings, 0 replies; 3+ messages in thread
From: Chao Fan @ 2017-03-21 8:52 UTC (permalink / raw)
To: Juan Quintela
Cc: qemu-devel, dgilbert, eblake, armbru, berrange, caoj.fnst,
douly.fnst, maozy.fnst, Li Zhijian
On Tue, Mar 21, 2017 at 09:22:52AM +0100, Juan Quintela wrote:
>Chao Fan <fanc.fnst@cn.fujitsu.com> wrote:
>> The number of dirty pages outputed in 'pages' in the command
>> 'info migrate', so add page-size to calculate the number of dirty
>> pages in bytes.
>>
>> Signed-off-by: Chao Fan <fanc.fnst@cn.fujitsu.com>
>> Signed-off-by: Li Zhijian <lizhijian@cn.fujitsu.com>
>>
>> ---
>> v2: fix the grammar in qapi-schema.json [Eric Blake]
>
>Hi
Hi Juan,
>
>If you see my RAMState series, you can see that things have moved a lot
>here, I added this to my current series:
>
>(there is a rename of qemu_target_page_bits() to qemu_target_page_size()
>in the series).
>
>If you like it, I can leave it that way there.
Yes, of course. This is a better way.
Thank you very much for your help!
Thanks,
Chao Fan
>
>Thanks, Juan.
>
>
>commit 1944568bd8cdf912b3bf231bbc3c66071fde9f58
>Author: Chao Fan <fanc.fnst@cn.fujitsu.com>
>Date: Tue Mar 21 10:22:43 2017 +0800
>
> Add page-size to output in 'info migrate'
>
> The number of dirty pages outputed in 'pages' in the command
> 'info migrate', so add page-size to calculate the number of dirty
> pages in bytes.
>
> Signed-off-by: Chao Fan <fanc.fnst@cn.fujitsu.com>
> Signed-off-by: Li Zhijian <lizhijian@cn.fujitsu.com>
> Signed-off-by: Juan Quintela <quintela@redhat.com>
>
>diff --git a/hmp.c b/hmp.c
>index edb8970..be75e71 100644
>--- a/hmp.c
>+++ b/hmp.c
>@@ -215,6 +215,9 @@ void hmp_info_migrate(Monitor *mon, const QDict *qdict)
> info->ram->normal_bytes >> 10);
> monitor_printf(mon, "dirty sync count: %" PRIu64 "\n",
> info->ram->dirty_sync_count);
>+ monitor_printf(mon, "page size: %" PRIu64 " kbytes\n",
>+ info->ram->page_size >> 10);
>+
> if (info->ram->dirty_pages_rate) {
> monitor_printf(mon, "dirty pages rate: %" PRIu64 " pages\n",
> info->ram->dirty_pages_rate);
>diff --git a/migration/migration.c b/migration/migration.c
>index 92c3c6b..fc19ba7 100644
>--- a/migration/migration.c
>+++ b/migration/migration.c
>@@ -650,6 +650,7 @@ static void populate_ram_info(MigrationInfo *info, MigrationState *s)
> info->ram->mbps = s->mbps;
> info->ram->dirty_sync_count = ram_dirty_sync_count();
> info->ram->postcopy_requests = ram_postcopy_requests();
>+ info->ram->page_size = qemu_target_page_size();
>
> if (s->state != MIGRATION_STATUS_COMPLETED) {
> info->ram->remaining = ram_bytes_remaining();
>diff --git a/qapi-schema.json b/qapi-schema.json
>index 68a4327..c7ec62c 100644
>--- a/qapi-schema.json
>+++ b/qapi-schema.json
>@@ -598,6 +598,9 @@
> # @postcopy-requests: The number of page requests received from the destination
> # (since 2.7)
> #
>+# @page-size: The number of bytes per page for the various page-based
>+# statistics (since 2.10)
>+#
> # Since: 0.14.0
> ##
> { 'struct': 'MigrationStats',
>@@ -605,7 +608,7 @@
> 'duplicate': 'int', 'skipped': 'int', 'normal': 'int',
> 'normal-bytes': 'int', 'dirty-pages-rate' : 'int',
> 'mbps' : 'number', 'dirty-sync-count' : 'int',
>- 'postcopy-requests' : 'int' } }
>+ 'postcopy-requests' : 'int', 'page-size' : 'int' } }
>
> ##
> # @XBZRLECacheStats:
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-03-21 8:53 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-21 2:22 [Qemu-devel] [PATCH v2] Add page-size to output in 'info migrate' Chao Fan
2017-03-21 8:22 ` Juan Quintela
2017-03-21 8:52 ` Chao Fan
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).