From nobody Tue May 7 02:35:16 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.zohomail.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 (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1516622158814504.3031036522623; Mon, 22 Jan 2018 03:55:58 -0800 (PST) Received: from localhost ([::1]:37716 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edaha-0008Lo-P5 for importer@patchew.org; Mon, 22 Jan 2018 06:55:50 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50059) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edagi-0007wq-7r for qemu-devel@nongnu.org; Mon, 22 Jan 2018 06:54:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1edagf-0002TD-6y for qemu-devel@nongnu.org; Mon, 22 Jan 2018 06:54:56 -0500 Received: from mga06.intel.com ([134.134.136.31]:46677) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1edage-0002SK-UT for qemu-devel@nongnu.org; Mon, 22 Jan 2018 06:54:53 -0500 Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Jan 2018 03:54:51 -0800 Received: from devel-ww.sh.intel.com ([10.239.48.110]) by orsmga004.jf.intel.com with ESMTP; 22 Jan 2018 03:54:50 -0800 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,396,1511856000"; d="scan'208";a="168094350" From: Wei Wang To: qemu-devel@nongnu.org, peterx@redhat.com, quintela@redhat.com, dgilbert@redhat.com Date: Mon, 22 Jan 2018 19:36:39 +0800 Message-Id: <1516620999-25669-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.31 Subject: [Qemu-devel] [PATCH v2] 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 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 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Fixes: b15df1ae50 ("migration: cleanup stats update into function") The threshold size is changed to be recorded in s->threshold_size. Signed-off-by: Wei Wang Reviewed-by: Peter Xu Reviewed-by: Juan Quintela --- migration/migration.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) v1->v2 change: only commit log description change 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; =20 if (current_time < s->iteration_start_time + BUFFER_DELAY) { @@ -2222,7 +2221,7 @@ static void migration_update_counters(MigrationState = *s, transferred =3D qemu_ftell(s->to_dst_file) - s->iteration_initial_byte= s; time_spent =3D current_time - s->iteration_start_time; bandwidth =3D (double)transferred / time_spent; - threshold_size =3D bandwidth * s->parameters.downtime_limit; + s->threshold_size =3D bandwidth * s->parameters.downtime_limit; =20 s->mbps =3D (((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 =3D qemu_ftell(s->to_dst_file); =20 trace_migrate_transferred(transferred, time_spent, - bandwidth, threshold_size); + bandwidth, s->threshold_size); } =20 /* Migration thread iteration status */ --=20 1.8.3.1