From nobody Wed May 15 00:19:42 2024 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 1646305104336496.4356926561188; Thu, 3 Mar 2022 02:58:24 -0800 (PST) Received: from localhost ([::1]:34406 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nPjA7-00027O-Lo for importer@patchew.org; Thu, 03 Mar 2022 05:58:23 -0500 Received: from eggs.gnu.org ([209.51.188.92]:51330) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nPj6g-0006gG-Lk for qemu-devel@nongnu.org; Thu, 03 Mar 2022 05:54:51 -0500 Received: from prt-mail.chinatelecom.cn ([42.123.76.223]:35467 helo=chinatelecom.cn) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nPj6c-0001bu-Pm for qemu-devel@nongnu.org; Thu, 03 Mar 2022 05:54:50 -0500 Received: from clientip-182.150.57.243 (unknown [172.18.0.188]) by chinatelecom.cn (HERMES) with SMTP id 382882800B2; Thu, 3 Mar 2022 18:54:42 +0800 (CST) Received: from ([172.18.0.188]) by app0023 with ESMTP id 4b3eeeffa5474a388c3175d7c074a1c6 for qemu-devel@nongnu.org; Thu, 03 Mar 2022 18:54:44 CST HMM_SOURCE_IP: 172.18.0.188:49710.1245837869 HMM_ATTACHE_NUM: 0000 HMM_SOURCE_TYPE: SMTP X-189-SAVE-TO-SEND: +huangy81@chinatelecom.cn X-Transaction-ID: 4b3eeeffa5474a388c3175d7c074a1c6 X-Real-From: huangy81@chinatelecom.cn X-Receive-IP: 172.18.0.188 X-MEDUSA-Status: 0 From: huangy81@chinatelecom.cn To: qemu-devel Subject: [PATCH v1] tests/migration: Introduce dirty-ring-size option into guestperf Date: Thu, 3 Mar 2022 18:54:35 +0800 Message-Id: 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: , Cc: Hyman Huang , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , "Dr. David Alan Gilbert" , Juan Quintela Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1646305106941100001 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 | 6 +++++- tests/migration/guestperf/hardware.py | 8 ++++++-- tests/migration/guestperf/shell.py | 6 +++++- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/tests/migration/guestperf/engine.py b/tests/migration/guestper= f/engine.py index 87a6ab2..3d3f6bd 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,11 @@ 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..ecb2d98 100644 --- a/tests/migration/guestperf/shell.py +++ b/tests/migration/guestperf/shell.py @@ -60,6 +60,7 @@ 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 +90,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