From patchwork Tue Sep 1 14:46:02 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Jason J. Herne" X-Patchwork-Id: 512865 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 7154014076A for ; Wed, 2 Sep 2015 00:47:19 +1000 (AEST) Received: from localhost ([::1]:54783 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZWmps-0002Cd-Gw for incoming@patchwork.ozlabs.org; Tue, 01 Sep 2015 10:46:56 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53776) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZWmp9-000178-Pb for qemu-devel@nongnu.org; Tue, 01 Sep 2015 10:46:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZWmp7-0001aI-3h for qemu-devel@nongnu.org; Tue, 01 Sep 2015 10:46:11 -0400 Received: from e39.co.us.ibm.com ([32.97.110.160]:55370) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZWmp6-0001Z2-J9 for qemu-devel@nongnu.org; Tue, 01 Sep 2015 10:46:08 -0400 Received: from /spool/local by e39.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 1 Sep 2015 08:46:08 -0600 Received: from d01dlp01.pok.ibm.com (9.56.250.166) by e39.co.us.ibm.com (192.168.1.139) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 1 Sep 2015 08:46:07 -0600 X-Helo: d01dlp01.pok.ibm.com X-MailFrom: jjherne@linux.vnet.ibm.com X-RcptTo: qemu-devel@nongnu.org Received: from b01cxnp23032.gho.pok.ibm.com (b01cxnp23032.gho.pok.ibm.com [9.57.198.27]) by d01dlp01.pok.ibm.com (Postfix) with ESMTP id DC9CA38C804A for ; Tue, 1 Sep 2015 10:46:05 -0400 (EDT) Received: from d01av05.pok.ibm.com (d01av05.pok.ibm.com [9.56.224.195]) by b01cxnp23032.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t81Ek5RT54460448 for ; Tue, 1 Sep 2015 14:46:05 GMT Received: from d01av05.pok.ibm.com (localhost [127.0.0.1]) by d01av05.pok.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t81Ek404026864 for ; Tue, 1 Sep 2015 10:46:05 -0400 Received: from jason-ThinkPad-W530.endicott.ibm.com (jason-thinkpad-w530.endicott.ibm.com [9.60.75.193] (may be forged)) by d01av05.pok.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id t81Ek33N026763; Tue, 1 Sep 2015 10:46:04 -0400 From: "Jason J. Herne" To: afaerber@suse.de, amit.shah@redhat.com, dgilbert@redhat.com, borntraeger@de.ibm.com, quintela@redhat.com, qemu-devel@nongnu.org, pbonzini@redhat.com Date: Tue, 1 Sep 2015 10:46:02 -0400 Message-Id: <1441118763-17510-5-git-send-email-jjherne@linux.vnet.ibm.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1441118763-17510-1-git-send-email-jjherne@linux.vnet.ibm.com> References: <1441118763-17510-1-git-send-email-jjherne@linux.vnet.ibm.com> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15090114-0033-0000-0000-000005B55C15 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 32.97.110.160 Cc: "Jason J. Herne" Subject: [Qemu-devel] [PATCH v5 4/5] qmp/hmp: Add throttle ratio to query-migrate and info migrate X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Report throttle percentage in info migrate and query-migrate responses when cpu throttling is active. Signed-off-by: Jason J. Herne Reviewed-by: Dr. David Alan Gilbert --- hmp.c | 5 +++++ migration/migration.c | 5 +++++ qapi-schema.json | 7 ++++++- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/hmp.c b/hmp.c index eb65998..36bc76e 100644 --- a/hmp.c +++ b/hmp.c @@ -229,6 +229,11 @@ void hmp_info_migrate(Monitor *mon, const QDict *qdict) info->xbzrle_cache->overflow); } + if (info->has_x_cpu_throttle_percentage) { + monitor_printf(mon, "cpu throttle percentage: %" PRIu64 "\n", + info->x_cpu_throttle_percentage); + } + qapi_free_MigrationInfo(info); qapi_free_MigrationCapabilityStatusList(caps); } diff --git a/migration/migration.c b/migration/migration.c index 7708c54..b29450a 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -274,6 +274,11 @@ MigrationInfo *qmp_query_migrate(Error **errp) info->disk->total = blk_mig_bytes_total(); } + if (cpu_throttle_active()) { + info->has_x_cpu_throttle_percentage = true; + info->x_cpu_throttle_percentage = cpu_throttle_get_percentage(); + } + get_xbzrle_cache_stats(info); break; case MIGRATION_STATUS_COMPLETED: diff --git a/qapi-schema.json b/qapi-schema.json index 52b7e07..c2bd8ce 100644 --- a/qapi-schema.json +++ b/qapi-schema.json @@ -474,6 +474,10 @@ # may be expensive, but do not actually occur during the iterative # migration rounds themselves. (since 1.6) # +# @x-cpu-throttle-percentage: #optional percentage of time guest cpus are being +# throttled during auto-converge. This is only present when auto-converge +# has started throttling guest cpus. (Since 2.4) +# # Since: 0.14.0 ## { 'struct': 'MigrationInfo', @@ -483,7 +487,8 @@ '*total-time': 'int', '*expected-downtime': 'int', '*downtime': 'int', - '*setup-time': 'int'} } + '*setup-time': 'int', + '*x-cpu-throttle-percentage': 'int'} } ## # @query-migrate