From patchwork Thu Sep 21 12:32:32 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Lieven X-Patchwork-Id: 9963823 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 831B96056A for ; Thu, 21 Sep 2017 12:33:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 77591294AE for ; Thu, 21 Sep 2017 12:33:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6BFD0294B4; Thu, 21 Sep 2017 12:33:35 +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 6F6FE294AE for ; Thu, 21 Sep 2017 12:33:33 +0000 (UTC) Received: from localhost ([::1]:53461 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dv0fc-0005C1-Ta for patchwork-qemu-devel@patchwork.kernel.org; Thu, 21 Sep 2017 08:33:32 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44905) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dv0es-00059E-7X for qemu-devel@nongnu.org; Thu, 21 Sep 2017 08:32:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dv0ep-0001DI-3V for qemu-devel@nongnu.org; Thu, 21 Sep 2017 08:32:46 -0400 Received: from mx-v6.kamp.de ([2a02:248:0:51::16]:39962 helo=mx01.kamp.de) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dv0eo-0001BW-Qu for qemu-devel@nongnu.org; Thu, 21 Sep 2017 08:32:43 -0400 Received: (qmail 15218 invoked by uid 89); 21 Sep 2017 12:32:39 -0000 Received: from [195.62.97.28] by client-16-kamp (envelope-from , uid 89) with qmail-scanner-2010/03/19-MF (clamdscan: 0.99.2/23859. avast: 1.2.2/17010300. spamassassin: 3.4.1. Clear:RC:1(195.62.97.28):. Processed in 0.071781 secs); 21 Sep 2017 12:32:39 -0000 Received: from smtp.kamp.de (HELO submission.kamp.de) ([195.62.97.28]) by mx01.kamp.de with ESMTPS (DHE-RSA-AES256-GCM-SHA384 encrypted); 21 Sep 2017 12:32:38 -0000 X-GL_Whitelist: yes Received: (qmail 28563 invoked from network); 21 Sep 2017 12:32:38 -0000 Received: from lieven-pc.kamp-intra.net (HELO lieven-pc) (relay@kamp.de@::ffff:172.21.12.60) by submission.kamp.de with ESMTPS (DHE-RSA-AES256-GCM-SHA384 encrypted) ESMTPA; 21 Sep 2017 12:32:38 -0000 Received: by lieven-pc (Postfix, from userid 1000) id 9746B20860; Thu, 21 Sep 2017 14:32:38 +0200 (CEST) From: Peter Lieven To: qemu-devel@nongnu.org Date: Thu, 21 Sep 2017 14:32:32 +0200 Message-Id: <1505997152-16980-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] X-Received-From: 2a02:248:0:51::16 Subject: [Qemu-devel] [PATCH] migration: disable auto-converge during bulk block 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, quintela@redhat.com, Peter Lieven , dgilbert@redhat.com, qemu-stable@nongnu.org, stefanha@redhat.com, pbonzini@redhat.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP auto-converge and block migration currently do not play well together. During block migration the auto-converge logic detects that ram migration makes no progress and thus throttles down the vm until it nearly stalls completely. Avoid this by disabling the throttling logic during the bulk phase of the block migration. Cc: qemu-stable@nongnu.org Signed-off-by: Peter Lieven --- migration/block.c | 5 +++++ migration/block.h | 7 +++++++ migration/ram.c | 3 ++- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/migration/block.c b/migration/block.c index 9171f60..606ad4d 100644 --- a/migration/block.c +++ b/migration/block.c @@ -161,6 +161,11 @@ int blk_mig_active(void) return !QSIMPLEQ_EMPTY(&block_mig_state.bmds_list); } +int blk_mig_bulk_active(void) +{ + return blk_mig_active() && !block_mig_state.bulk_completed; +} + uint64_t blk_mig_bytes_transferred(void) { BlkMigDevState *bmds; diff --git a/migration/block.h b/migration/block.h index 22ebe94..3178609 100644 --- a/migration/block.h +++ b/migration/block.h @@ -16,6 +16,7 @@ #ifdef CONFIG_LIVE_BLOCK_MIGRATION int blk_mig_active(void); +int blk_mig_bulk_active(void); uint64_t blk_mig_bytes_transferred(void); uint64_t blk_mig_bytes_remaining(void); uint64_t blk_mig_bytes_total(void); @@ -25,6 +26,12 @@ static inline int blk_mig_active(void) { return false; } + +static inline int blk_mig_bulk_active(void) +{ + return false; +} + static inline uint64_t blk_mig_bytes_transferred(void) { return 0; diff --git a/migration/ram.c b/migration/ram.c index e18b3e2..720470e 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -46,6 +46,7 @@ #include "exec/ram_addr.h" #include "qemu/rcu_queue.h" #include "migration/colo.h" +#include "migration/block.h" /***********************************************************/ /* ram save/restore */ @@ -623,7 +624,7 @@ static void migration_bitmap_sync(RAMState *rs) / (end_time - rs->time_last_bitmap_sync); bytes_xfer_now = ram_counters.transferred; - if (migrate_auto_converge()) { + if (migrate_auto_converge() && !blk_mig_bulk_active()) { /* The following detection logic can be refined later. For now: Check to see if the dirtied bytes is 50% more than the approx. amount of bytes that just got transferred since the last time we