From patchwork Tue Mar 14 07:57:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: 858585 jemmy X-Patchwork-Id: 9622641 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 C636760244 for ; Tue, 14 Mar 2017 07:58:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B592E284F4 for ; Tue, 14 Mar 2017 07:58:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A9D4C28517; Tue, 14 Mar 2017 07:58:11 +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.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID 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 52827284F4 for ; Tue, 14 Mar 2017 07:58:11 +0000 (UTC) Received: from localhost ([::1]:56958 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cnhLO-0002Yd-1Z for patchwork-qemu-devel@patchwork.kernel.org; Tue, 14 Mar 2017 03:58:10 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36337) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cnhLD-0002Y9-0I for qemu-devel@nongnu.org; Tue, 14 Mar 2017 03:57:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cnhLC-0003uK-BH for qemu-devel@nongnu.org; Tue, 14 Mar 2017 03:57:59 -0400 Received: from mail-pg0-x241.google.com ([2607:f8b0:400e:c05::241]:36109) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cnhL8-0003kt-2s; Tue, 14 Mar 2017 03:57:54 -0400 Received: by mail-pg0-x241.google.com with SMTP id 25so22782993pgy.3; Tue, 14 Mar 2017 00:57:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=5YpXivYKv31qizuC9cfpE7VNYh3bl4xnLeNNeEM/Oc8=; b=SEU5/maB3yoayPJgKgbdYNGNqOWi1e07UV/vuHKOTJl18gBHcwzpPIb1CtxZzPJpEu MC66rktYt7TXY6dgetXW/S+Bf6v5fyiOBG0+/RdRf0lCrjd+5M6Zpybjnln0nvtMUCK3 If4deLF4BIUNfpc8Qr08RBuWxFI+XH+uJfZMs2bVwerfy/0b/2c+JnYYYiA+jsfHef6y aL2itQskk+0K219EkBjBa6msSaP7E4VwFX+CcIkGmSED4G+S4TTAyieIgdN3CTZii4Yj twEORtYIp9/Q3peKheF+XkGjQuWuY2gyVG4fp05KdCRkHkdQHeLB9AYEzgSEutX+7J3T 8SBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=5YpXivYKv31qizuC9cfpE7VNYh3bl4xnLeNNeEM/Oc8=; b=KlkVdJy8jXY7b92w8Pkqjwe45ohulKppdjEP91ONqDWleVyILxbCjoQm+KCP9a0vSa IxhblYRyQtLQyho1ybQXQVpVe0/lhlvFeBPYxst5ZqLrehBbwKVESrjvNTFI3JfDvT/W DXlm/KIh4Y66F3QnRPrY93c2YG3zTnYn7xPyFoJRu9KRzs8baZ529/vtMXrarLYGYPo5 5Yw8X/57+gAQqQWiILcSBksdLFrxRuJg/VmLtU6a/WGrY+wv1rs4rmLGGp9cycNlB/xj uulkuBdtfcTM8HneX/nvG4aovJFaKrcz7wjSDYOxvcwJrhXH+cedoWqfskpd+bANzYEL iDqA== X-Gm-Message-State: AMke39ny04sYlHmmaZ2iBynFO3U2m1sZx/IPBRBoaNC3IH0EwxiBG4k1Lxa9PcNGZSvy/A== X-Received: by 10.98.29.216 with SMTP id d207mr42262510pfd.144.1489478272570; Tue, 14 Mar 2017 00:57:52 -0700 (PDT) Received: from localhost.localdomain ([119.28.70.108]) by smtp.gmail.com with ESMTPSA id v4sm36706324pfb.36.2017.03.14.00.57.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Mar 2017 00:57:52 -0700 (PDT) From: jemmy858585@gmail.com To: stefanha@redhat.com, famz@redhat.com, quintela@redhat.com, dgilbert@redhat.com, qemu-block@nongnu.org, qemu-devel@nongnu.org Date: Tue, 14 Mar 2017 15:57:23 +0800 Message-Id: <1489478243-10366-1-git-send-email-jemmy858585@gmail.com> X-Mailer: git-send-email 1.8.3.1 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:400e:c05::241 Subject: [Qemu-devel] [PATCH] migration/block: Avoid involve into blk_drain too frequently 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: Lidong Chen Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Lidong Chen Increase bmds->cur_dirty after submit io, so reduce the frequency involve into blk_drain, and improve the performance obviously when block migration. Signed-off-by: Lidong Chen --- migration/block.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/migration/block.c b/migration/block.c index 6741228..f059cca 100644 --- a/migration/block.c +++ b/migration/block.c @@ -576,6 +576,8 @@ static int mig_save_device_dirty(QEMUFile *f, BlkMigDevState *bmds, } bdrv_reset_dirty_bitmap(bmds->dirty_bitmap, sector, nr_sectors); + sector += nr_sectors; + bmds->cur_dirty = sector; break; } sector += BDRV_SECTORS_PER_DIRTY_CHUNK;