From nobody Wed May 1 12:47:46 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1489653842906845.1935111473579; Thu, 16 Mar 2017 01:44:02 -0700 (PDT) Received: from localhost ([::1]:41643 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1coR0r-0008No-25 for importer@patchew.org; Thu, 16 Mar 2017 04:44:01 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37681) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1coR0M-0008NW-OX for qemu-devel@nongnu.org; Thu, 16 Mar 2017 04:43:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1coR0J-0000Cr-Is for qemu-devel@nongnu.org; Thu, 16 Mar 2017 04:43:30 -0400 Received: from [59.151.112.132] (port=35305 helo=heian.cn.fujitsu.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1coR0I-0000AU-Ih for qemu-devel@nongnu.org; Thu, 16 Mar 2017 04:43:27 -0400 Received: from unknown (HELO cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 16 Mar 2017 16:43:06 +0800 Received: from G08CNEXCHPEKD01.g08.fujitsu.local (unknown [10.167.33.80]) by cn.fujitsu.com (Postfix) with ESMTP id 99D8F477AE90; Thu, 16 Mar 2017 16:43:03 +0800 (CST) Received: from localhost (10.167.226.75) by G08CNEXCHPEKD01.g08.fujitsu.local (10.167.33.89) with Microsoft SMTP Server id 14.3.319.2; Thu, 16 Mar 2017 16:43:02 +0800 X-IronPort-AV: E=Sophos;i="5.22,518,1449504000"; d="scan'208";a="16645907" From: Chao Fan To: , , , , , Date: Thu, 16 Mar 2017 16:42:29 +0800 Message-ID: <20170316084229.32497-1-fanc.fnst@cn.fujitsu.com> X-Mailer: git-send-email 2.9.3 MIME-Version: 1.0 X-yoursite-MailScanner-ID: 99D8F477AE90.AE253 X-yoursite-MailScanner: Found to be clean X-yoursite-MailScanner-From: fanc.fnst@cn.fujitsu.com X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 59.151.112.132 Subject: [Qemu-devel] [PATCH] Add page-size to output in 'info migrate' X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: douly.fnst@cn.fujitsu.com, caoj.fnst@cn.fujitsu.com, Chao Fan , maozy.fnst@cn.fujitsu.com, Li Zhijian Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 Signed-off-by: Li Zhijian --- 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; =20 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, Migr= ationState *s) info->ram->mbps =3D s->mbps; info->ram->dirty_sync_count =3D s->dirty_sync_count; info->ram->postcopy_requests =3D s->postcopy_requests; + info->ram->page_size =3D s->page_size; =20 if (s->state !=3D MIGRATION_STATUS_COMPLETED) { info->ram->remaining =3D ram_bytes_remaining(); @@ -1115,6 +1116,7 @@ MigrationState *migrate_init(const MigrationParams *p= arams) s->last_req_rb =3D NULL; error_free(s->error); s->error =3D NULL; + s->page_size =3D 0; =20 migrate_set_state(&s->state, MIGRATION_STATUS_NONE, MIGRATION_STATUS_S= ETUP); =20 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 =3D migrate_get_current(); =20 + s->page_size =3D 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..4658c3d 100644 --- a/qapi-schema.json +++ b/qapi-schema.json @@ -575,6 +575,9 @@ # @postcopy-requests: The number of page requests received from the destin= ation # (since 2.7) # +# @page-size: The number of bytes in page of this gutst. +# (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' } } =20 ## # @XBZRLECacheStats: --=20 2.9.3