From nobody Sun May 19 10:57:19 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=126.com ARC-Seal: i=1; a=rsa-sha256; t=1662645235; cv=none; d=zohomail.com; s=zohoarc; b=Lhb2T4NjoyblKCgWH3Wo4ULyEiuRVBdrRWnN27zwVav/9GPDje/RopyMKUvSpeiRljCgAVhavh0kD/p8QYXl9/ABsWSj6gEdkUaMnjVOh+6arCeCdq6jO69bC4gaRi4ainENdQAF7UfqwRIeG8WhyX7msbIXfy92piz/GOc/OkY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1662645235; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=q39WIljGeJlOyOA2Eu7qdBOmPg95WDfA7A74F/yEeII=; b=VEfhdK/lpeuJ/o8zORzCW1ir9sWCpxOdQvApbYN6j/XK7kP6aVvA3QBCtJXRrLnMBg14+l/Ft8AvJfz4DBcryEH8Cm8WxDZSd/hqAX6EzobBZ4M1JJebjDtu6tXzaRB2YbdDNy/Bza21rtrCmaTAHxJqEq5KrFA/reS5eT8pJtk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 166264523512196.16711440048482; Thu, 8 Sep 2022 06:53:55 -0700 (PDT) Received: from localhost ([::1]:53858 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oWHyb-00054Q-NS for importer@patchew.org; Thu, 08 Sep 2022 09:53:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48024) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oWHoB-00019R-UC; Thu, 08 Sep 2022 09:43:07 -0400 Received: from m15112.mail.126.com ([220.181.15.112]:62335) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oWHo4-0005Lv-NC; Thu, 08 Sep 2022 09:43:04 -0400 Received: from localhost.localdomain (unknown [58.56.96.29]) by smtp2 (Coremail) with SMTP id DMmowACnNLFY8Rlj5ZvCBA--.12758S2; Thu, 08 Sep 2022 21:42:48 +0800 (CST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=126.com; s=s110527; h=From:Subject:Date:Message-Id:MIME-Version; bh=q39WI ljGeJlOyOA2Eu7qdBOmPg95WDfA7A74F/yEeII=; b=UDI9QBJFjewTigCnNuUKs wGgjOj3eSenubr+C0pPJjfh5GLVFYW6yNGYNYcIuVjSjYTA5OwP+lHkXftvNg7DU 4LIILalszHEU0TQzjLShBn/KJLtDGIl/AuGnrjhRhTDsWj2ZeDOLzy0lPzqYfQ0B I+JwnB+0xG0HKUI8oPVUBE= From: liuhaiwei To: qemu-devel@nongnu.org, qemu-block@nongnu.org Cc: stefanha@redhat.com, fam@euphon.net, eblake@redhat.com, vsementsov@yandex-team.ru, jsnow@redhat.com, quintela@redhat.com, dgilbert@redhat.com, liuhaiwei , liuhaiwei Subject: [PATCH] migrate block dirty bitmap: Fix the block dirty bitmap can't to migration_completion when pending size larger than threshold size Date: Thu, 8 Sep 2022 09:42:36 -0400 Message-Id: <20220908134236.541312-1-liuhaiwei9699@126.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-CM-TRANSID: DMmowACnNLFY8Rlj5ZvCBA--.12758S2 X-Coremail-Antispam: 1Uf129KBjvdXoWrurW5tF4kGF48Gr4xurW5Awb_yoWDZwc_Kw 48Ga1xG347AwnxCF98Xr15Jrn8A34kC3W7W3yIqFyxXa48AasrGw4vvrs3trs7XFWDCrW3 W3yrXFy2yrn8GjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IU5j385UUUUU== X-Originating-IP: [58.56.96.29] X-CM-SenderInfo: xolxxt5lzhxmqwzzqiyswou0bp/1tbiuBl21mJVlRRhcwAAsl Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=220.181.15.112; envelope-from=liuhaiwei9699@126.com; helo=m15112.mail.126.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @126.com) X-ZM-MESSAGEID: 1662645236447100003 From: liuhaiwei 1=E3=80=81dirty bitmap size big enough (such as 8MB) when block size 1T ; 2=E3=80=81we set the migrate speed or the bandwith is small enough(such as = 4MB/s) so we set the fake pending size when pending size > threshold size Signed-off-by: liuhaiwei Signed-off-by: liuhaiwei --- migration/block-dirty-bitmap.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/migration/block-dirty-bitmap.c b/migration/block-dirty-bitmap.c index 9aba7d9c22..40f5a1aaf9 100644 --- a/migration/block-dirty-bitmap.c +++ b/migration/block-dirty-bitmap.c @@ -782,7 +782,10 @@ static void dirty_bitmap_save_pending(QEMUFile *f, voi= d *opaque, } =20 qemu_mutex_unlock_iothread(); - + /*we set the fake pending size when the dirty bitmap size more than m= ax_size */ + if(pending > max_size && max_size !=3D 0){ + pending =3D max_size - 1; + } trace_dirty_bitmap_save_pending(pending, max_size); =20 *res_postcopy_only +=3D pending; --=20 2.27.0