From nobody Tue Feb 10 07:24:00 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1662053680426325.05581632717485; Thu, 1 Sep 2022 10:34:40 -0700 (PDT) Received: from localhost ([::1]:38884 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oTo5P-0002Sc-5B for importer@patchew.org; Thu, 01 Sep 2022 13:34:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35532) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oTnuG-0000WG-5C for qemu-devel@nongnu.org; Thu, 01 Sep 2022 13:23:08 -0400 Received: from prt-mail.chinatelecom.cn ([42.123.76.223]:56547 helo=chinatelecom.cn) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oTnuD-00039b-TZ for qemu-devel@nongnu.org; Thu, 01 Sep 2022 13:23:07 -0400 Received: from clientip-171.223.99.60 (unknown [172.18.0.218]) by chinatelecom.cn (HERMES) with SMTP id 471FC2800DC; Fri, 2 Sep 2022 01:23:02 +0800 (CST) Received: from ([172.18.0.218]) by app0025 with ESMTP id 8918d48e72754b2bb6ef3e6d6ab3127e for qemu-devel@nongnu.org; Fri, 02 Sep 2022 01:23:04 CST HMM_SOURCE_IP: 172.18.0.218:57590.1734067809 HMM_ATTACHE_NUM: 0000 HMM_SOURCE_TYPE: SMTP X-189-SAVE-TO-SEND: +huangy81@chinatelecom.cn X-Transaction-ID: 8918d48e72754b2bb6ef3e6d6ab3127e X-Real-From: huangy81@chinatelecom.cn X-Receive-IP: 172.18.0.218 X-MEDUSA-Status: 0 From: huangy81@chinatelecom.cn To: qemu-devel Cc: Peter Xu , Juan Quintela , "Dr. David Alan Gilbert" , Eric Blake , Markus Armbruster , Thomas Huth , Laurent Vivier , Paolo Bonzini , "Daniel P. Berrange" , =?UTF-8?q?Hyman=20Huang=28=E9=BB=84=E5=8B=87=29?= Subject: [PATCH v1 7/8] tests/migration: Introduce dirty-ring-size option into guestperf Date: Fri, 2 Sep 2022 01:22:35 +0800 Message-Id: <023bb67f913a1d1d534d58a2eb217418eca92a12.1662052189.git.huangy81@chinatelecom.cn> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: References: In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=42.123.76.223; envelope-from=huangy81@chinatelecom.cn; helo=chinatelecom.cn 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, SPF_HELO_PASS=-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-ZM-MESSAGEID: 1662053682053100001 From: Hyman Huang(=E9=BB=84=E5=8B=87) Guestperf tool does not enable diry ring feature when test migration by default. To support dirty ring migration performance test, introduce dirty-ring-size option into guestperf tools, which ranges in [1024, 65536]. To set dirty ring size with 4096 during migration test: $ ./tests/migration/guestperf.py --dirty-ring-size 4096 xxx Signed-off-by: Hyman Huang(=E9=BB=84=E5=8B=87) --- tests/migration/guestperf/engine.py | 7 ++++++- tests/migration/guestperf/hardware.py | 8 ++++++-- tests/migration/guestperf/shell.py | 7 ++++++- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/tests/migration/guestperf/engine.py b/tests/migration/guestper= f/engine.py index 87a6ab2..2b98f00 100644 --- a/tests/migration/guestperf/engine.py +++ b/tests/migration/guestperf/engine.py @@ -304,7 +304,6 @@ def _get_common_args(self, hardware, tunnelled=3DFalse): cmdline =3D "'" + cmdline + "'" =20 argv =3D [ - "-accel", "kvm", "-cpu", "host", "-kernel", self._kernel, "-initrd", self._initrd, @@ -315,6 +314,12 @@ def _get_common_args(self, hardware, tunnelled=3DFalse= ): "-smp", str(hardware._cpus), ] =20 + if hardware._dirty_ring_size: + argv.extend(["-accel", "kvm,dirty-ring-size=3D%s" % + hardware._dirty_ring_size]) + else: + argv.extend(["-accel", "kvm"]) + if self._debug: argv.extend(["-device", "sga"]) =20 diff --git a/tests/migration/guestperf/hardware.py b/tests/migration/guestp= erf/hardware.py index 3145785..f779cc0 100644 --- a/tests/migration/guestperf/hardware.py +++ b/tests/migration/guestperf/hardware.py @@ -23,7 +23,8 @@ def __init__(self, cpus=3D1, mem=3D1, src_cpu_bind=3DNone, src_mem_bind=3DNone, dst_cpu_bind=3DNone, dst_mem_bind=3DNone, prealloc_pages =3D False, - huge_pages=3DFalse, locked_pages=3DFalse): + huge_pages=3DFalse, locked_pages=3DFalse, + dirty_ring_size=3D0): self._cpus =3D cpus self._mem =3D mem # GiB self._src_mem_bind =3D src_mem_bind # List of NUMA nodes @@ -33,6 +34,7 @@ def __init__(self, cpus=3D1, mem=3D1, self._prealloc_pages =3D prealloc_pages self._huge_pages =3D huge_pages self._locked_pages =3D locked_pages + self._dirty_ring_size =3D dirty_ring_size =20 =20 def serialize(self): @@ -46,6 +48,7 @@ def serialize(self): "prealloc_pages": self._prealloc_pages, "huge_pages": self._huge_pages, "locked_pages": self._locked_pages, + "dirty_ring_size": self._dirty_ring_size, } =20 @classmethod @@ -59,4 +62,5 @@ def deserialize(cls, data): data["dst_mem_bind"], data["prealloc_pages"], data["huge_pages"], - data["locked_pages"]) + data["locked_pages"], + data["dirty_ring_size"]) diff --git a/tests/migration/guestperf/shell.py b/tests/migration/guestperf= /shell.py index 8a809e3..559616f 100644 --- a/tests/migration/guestperf/shell.py +++ b/tests/migration/guestperf/shell.py @@ -60,6 +60,8 @@ def __init__(self): parser.add_argument("--prealloc-pages", dest=3D"prealloc_pages", d= efault=3DFalse) parser.add_argument("--huge-pages", dest=3D"huge_pages", default= =3DFalse) parser.add_argument("--locked-pages", dest=3D"locked_pages", defau= lt=3DFalse) + parser.add_argument("--dirty-ring-size", dest=3D"dirty_ring_size", + default=3D0, type=3Dint) =20 self._parser =3D parser =20 @@ -89,7 +91,10 @@ def split_map(value): =20 locked_pages=3Dargs.locked_pages, huge_pages=3Dargs.huge_pages, - prealloc_pages=3Dargs.prealloc_pages) + prealloc_pages=3Dargs.prealloc_pages, + + dirty_ring_size=3Dargs.dirty_ring_size) + =20 =20 class Shell(BaseShell): --=20 1.8.3.1