From patchwork Thu Mar 8 11:18:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Lieven X-Patchwork-Id: 883072 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=kamp.de Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zxp2t6yyCz9shR for ; Thu, 8 Mar 2018 22:20:22 +1100 (AEDT) Received: from localhost ([::1]:38067 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ettau-0005Bw-Q8 for incoming@patchwork.ozlabs.org; Thu, 08 Mar 2018 06:20:20 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40283) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ettZJ-0004Wi-K6 for qemu-devel@nongnu.org; Thu, 08 Mar 2018 06:18:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ettZH-000205-OP for qemu-devel@nongnu.org; Thu, 08 Mar 2018 06:18:41 -0500 Received: from mx-v6.kamp.de ([2a02:248:0:51::16]:37955 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 1ettZH-0001ze-Et for qemu-devel@nongnu.org; Thu, 08 Mar 2018 06:18:39 -0500 Received: (qmail 11156 invoked by uid 89); 8 Mar 2018 11:18:35 -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.4/24374. avast: 1.2.2/17010300. spamassassin: 3.4.1. Clear:RC:1(195.62.97.192):. Processed in 0.260052 secs); 08 Mar 2018 11:18:35 -0000 Received: from kerio.kamp.de ([195.62.97.192]) by mx01.kamp.de with ESMTPS (DHE-RSA-AES256-SHA encrypted); 8 Mar 2018 11:18:32 -0000 X-GL_Whitelist: yes X-Footer: a2FtcC5kZQ== 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; Thu, 8 Mar 2018 12:18:28 +0100 Received: (qmail 5256 invoked from network); 8 Mar 2018 11:18:29 -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; 8 Mar 2018 11:18:29 -0000 Received: by lieven-vm-neu (Postfix, from userid 1060) id 6CC5B204FA; Thu, 8 Mar 2018 12:18:29 +0100 (CET) From: Peter Lieven To: qemu-devel@nongnu.org, qemu-block@nongnu.org Date: Thu, 8 Mar 2018 12:18:27 +0100 Message-Id: <1520507908-16743-5-git-send-email-pl@kamp.de> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1520507908-16743-1-git-send-email-pl@kamp.de> References: <1520507908-16743-1-git-send-email-pl@kamp.de> 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 4/5] migration/block: limit the number of parallel I/O requests 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" the current implementation submits up to 512 I/O requests in parallel which is much to high especially for a background task. This patch adds a maximum limit of 16 I/O requests that can be submitted in parallel to avoid monopolizing the I/O device. Signed-off-by: Peter Lieven Reviewed-by: Juan Quintela --- migration/block.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/migration/block.c b/migration/block.c index 41b95d1..ce939e2 100644 --- a/migration/block.c +++ b/migration/block.c @@ -37,6 +37,7 @@ #define MAX_IS_ALLOCATED_SEARCH (65536 * BDRV_SECTOR_SIZE) #define MAX_IO_BUFFERS 512 +#define MAX_PARALLEL_IO 16 //#define DEBUG_BLK_MIGRATION @@ -775,6 +776,7 @@ static int block_save_iterate(QEMUFile *f, void *opaque) while ((block_mig_state.submitted + block_mig_state.read_done) * BLOCK_SIZE < qemu_file_get_rate_limit(f) && + block_mig_state.submitted < MAX_PARALLEL_IO && (block_mig_state.submitted + block_mig_state.read_done) < MAX_IO_BUFFERS) { blk_mig_unlock();