From patchwork Tue Jan 16 10:51:32 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Wang, Wei W" X-Patchwork-Id: 10166529 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D8023600CA for ; Tue, 16 Jan 2018 11:10:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D34472834A for ; Tue, 16 Jan 2018 11:10:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C2F982835B; Tue, 16 Jan 2018 11:10:33 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 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 mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 3EAA92834A for ; Tue, 16 Jan 2018 11:10:32 +0000 (UTC) Received: from localhost ([::1]:56676 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ebP8S-0004xd-7x for patchwork-qemu-devel@patchwork.kernel.org; Tue, 16 Jan 2018 06:10:32 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51996) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ebP7n-0004Up-F9 for qemu-devel@nongnu.org; Tue, 16 Jan 2018 06:09:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ebP7j-0000ZU-6G for qemu-devel@nongnu.org; Tue, 16 Jan 2018 06:09:51 -0500 Received: from mga09.intel.com ([134.134.136.24]:23074) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ebP7i-0000Ys-T7 for qemu-devel@nongnu.org; Tue, 16 Jan 2018 06:09:47 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 16 Jan 2018 03:09:45 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,368,1511856000"; d="scan'208";a="166467786" Received: from devel-ww.sh.intel.com ([10.239.48.110]) by orsmga004.jf.intel.com with ESMTP; 16 Jan 2018 03:09:43 -0800 From: Wei Wang To: qemu-devel@nongnu.org Date: Tue, 16 Jan 2018 18:51:32 +0800 Message-Id: <1516099892-34247-1-git-send-email-wei.w.wang@intel.com> X-Mailer: git-send-email 2.7.4 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 134.134.136.24 Subject: [Qemu-devel] [PATCH v1] migration: use s->threshold_size inside migration_update_counters 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: Wei Wang , dgilbert@redhat.com, peterx@redhat.com, quintela@redhat.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP The threshold size is changed to be recorded in s->threshold_size by commit b15df1ae5063c7c181f8f068f9eba7661b3b5e1. Signed-off-by: Wei Wang Reviewed-by: Peter Xu --- migration/migration.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/migration/migration.c b/migration/migration.c index d3a1c49..bfd1a16 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -2212,7 +2212,6 @@ static void migration_update_counters(MigrationState *s, int64_t current_time) { uint64_t transferred, time_spent; - int64_t threshold_size; double bandwidth; if (current_time < s->iteration_start_time + BUFFER_DELAY) { @@ -2222,7 +2221,7 @@ static void migration_update_counters(MigrationState *s, transferred = qemu_ftell(s->to_dst_file) - s->iteration_initial_bytes; time_spent = current_time - s->iteration_start_time; bandwidth = (double)transferred / time_spent; - threshold_size = bandwidth * s->parameters.downtime_limit; + s->threshold_size = bandwidth * s->parameters.downtime_limit; s->mbps = (((double) transferred * 8.0) / ((double) time_spent / 1000.0)) / 1000.0 / 1000.0; @@ -2242,7 +2241,7 @@ static void migration_update_counters(MigrationState *s, s->iteration_initial_bytes = qemu_ftell(s->to_dst_file); trace_migrate_transferred(transferred, time_spent, - bandwidth, threshold_size); + bandwidth, s->threshold_size); } /* Migration thread iteration status */