From nobody Fri Oct 24 09:58:53 2025 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 (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1519139650686424.0024847915996; Tue, 20 Feb 2018 07:14:10 -0800 (PST) Received: from localhost ([::1]:56059 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eo9cP-0007uE-R2 for importer@patchew.org; Tue, 20 Feb 2018 10:14:09 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36907) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eo9Yd-0004pP-6v for qemu-devel@nongnu.org; Tue, 20 Feb 2018 10:10:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eo9YY-0000uJ-80 for qemu-devel@nongnu.org; Tue, 20 Feb 2018 10:10:15 -0500 Received: from mx01.kamp.de ([82.141.2.16]:50820) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eo9YX-0000tL-Ug for qemu-devel@nongnu.org; Tue, 20 Feb 2018 10:10:10 -0500 Received: (qmail 29206 invoked by uid 89); 20 Feb 2018 15:10:07 -0000 Received: from [195.62.97.192] by client-16-kamp (envelope-from , uid 89) with qmail-scanner-2010/03/19-MF (clamdscan: 0.99.3/24332. avast: 1.2.2/17010300. spamassassin: 3.4.1. Clear:RC:1(195.62.97.192):. Processed in 0.141117 secs); 20 Feb 2018 15:10:07 -0000 Received: from kerio.kamp.de ([195.62.97.192]) by mx01.kamp.de with ESMTPS (DHE-RSA-AES256-SHA encrypted); 20 Feb 2018 15:10:06 -0000 Received: from submission.kamp.de ([195.62.97.28]) by kerio.kamp.de with ESMTPS (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256 bits)) for qemu-devel@nongnu.org; Tue, 20 Feb 2018 16:10:03 +0100 Received: (qmail 13403 invoked from network); 20 Feb 2018 15:10:04 -0000 Received: from lieven-vm.kamp-intra.net (HELO lieven-vm-neu) (relay@kamp.de@::ffff:172.21.12.69) by submission.kamp.de with ESMTPS (DHE-RSA-AES256-GCM-SHA384 encrypted) ESMTPA; 20 Feb 2018 15:10:04 -0000 Received: by lieven-vm-neu (Postfix, from userid 1060) id 5303720286; Tue, 20 Feb 2018 16:10:04 +0100 (CET) X-GL_Whitelist: yes X-Footer: a2FtcC5kZQ== From: Peter Lieven To: qemu-devel@nongnu.org, qemu-block@nongnu.org Date: Tue, 20 Feb 2018 16:10:03 +0100 Message-Id: <1519139403-2646-1-git-send-email-pl@kamp.de> X-Mailer: git-send-email 1.9.1 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 82.141.2.16 Subject: [Qemu-devel] [PATCH] migration: do not transfer ram during bulk storage migration 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: famz@redhat.com, stefanha@redhat.com, quintela@redhat.com, Peter Lieven , dgilbert@redhat.com, jjherne@linux.vnet.ibm.com 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" this patch makes the bulk phase of a block migration to take place before we start transferring ram. As the bulk block migration can take a long time its pointless to transfer ram during that phase. Signed-off-by: Peter Lieven Reviewed-by: Stefan Hajnoczi --- migration/ram.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/migration/ram.c b/migration/ram.c index 5e33e5c..42468ee 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -2258,6 +2258,13 @@ static int ram_save_iterate(QEMUFile *f, void *opaqu= e) int64_t t0; int done =3D 0; =20 + if (blk_mig_bulk_active()) { + /* Avoid transferring ram during bulk phase of block migration as + * the bulk phase will usually take a long time and transferring + * ram updates during that time is pointless. */ + goto out; + } + rcu_read_lock(); if (ram_list.version !=3D rs->last_version) { ram_state_reset(rs); @@ -2304,6 +2311,7 @@ static int ram_save_iterate(QEMUFile *f, void *opaque) */ ram_control_after_iterate(f, RAM_CONTROL_ROUND); =20 +out: qemu_put_be64(f, RAM_SAVE_FLAG_EOS); ram_counters.transferred +=3D 8; =20 --=20 2.7.4