From nobody Wed Oct 23 00:27:46 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=fail(p=none dis=none) header.from=smartx.com ARC-Seal: i=1; a=rsa-sha256; t=1729563357; cv=none; d=zohomail.com; s=zohoarc; b=amye2Xm21BaTWdC7q2+yXuajt3fpgL2WnksOyawD5mQi/cMVzEmmnIdHCN1H/uUHNo6epftHpJWvE7cN42ZY4P0R3LzVV4oDe9RyqbmAjHmpMjrRLaUoaxgO8wFhKUs0OG1M6HiD1Zpzvuyl+7G1GqZKaPxdavEAHnkfBYiE9FI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1729563357; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Zj16xsP69yRm8kfvS7x0oc4hUe/30vMQW6eBXthukQ8=; b=W5XE3B7CmOqf2vXLYj8P9fEgG3jNKBsTu6PeBin/MAMJn2W+fRn0yqjhyTO6TnASt+IUBXaluPist7qzGJDiPpPBt3+gdKnowCVXsNfaF0hNko1cTquAzAlEZDS3L855Pl9KJipsHSCj2wdWnvXnD33jFxDHKJik3hLFuWaRMQk= 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=fail 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 1729563357210389.70038702623276; Mon, 21 Oct 2024 19:15:57 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t34Q7-0005xC-5M; Mon, 21 Oct 2024 22:14:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t34Q4-0005wO-Lg for qemu-devel@nongnu.org; Mon, 21 Oct 2024 22:14:48 -0400 Received: from mail-pl1-x62b.google.com ([2607:f8b0:4864:20::62b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t34Q3-0001XX-0Q for qemu-devel@nongnu.org; Mon, 21 Oct 2024 22:14:48 -0400 Received: by mail-pl1-x62b.google.com with SMTP id d9443c01a7336-20bb39d97d1so47257575ad.2 for ; Mon, 21 Oct 2024 19:14:46 -0700 (PDT) Received: from Hyman-Dev-Euler.zelin.local ([103.172.41.198]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-20e7f0bd63fsm32726545ad.173.2024.10.21.19.14.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Oct 2024 19:14:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=smartx-com.20230601.gappssmtp.com; s=20230601; t=1729563285; x=1730168085; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Zj16xsP69yRm8kfvS7x0oc4hUe/30vMQW6eBXthukQ8=; b=hI8cFTLwjn5w6OPv5tBwgHoQP1makOHAVFMJ9aYQe4kW74jDxZWxuq4DPyncqZnvTa KFgGmT/XNKS3juWkfDGgUzbvo7mQT/kfcPuv79YkYjEdm0SLN5srzB87BqBz5r3p6AJ9 +lF4QDf1LMaQvj98BjM8tg7SK56d9qBu4C95fiy8M0V3xc6VHVC07yusFuXgBbS8gknv uWNZAIrEbitlPPotuHRdKnMqI77lrQXce65CFiD8V+QAsiqG+PIOA7YBRVFG2cyyHKfx kPQD4/fbJq9F0tSJaaHcF8n2LcQOnDj7PaApnxXXBbqkD5q5itQQBFq0DKshjQgA28lP bNFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729563285; x=1730168085; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Zj16xsP69yRm8kfvS7x0oc4hUe/30vMQW6eBXthukQ8=; b=LaU1xlBwfLL3zmvBl+5ynprVujfTOIkH54EVaW0FAiG/XR0jy/c2TZ8m9Lzi6Ansx8 YUmIxmJPPKsYzBKzDUsVTBcgjYXEoS5cdDJPY576bp/7OPQOgbDvbhm3jyPY8Brc38+o H3tDM3nmGIdne74d3mTdYvfpMPnikJ0tpRHVhDevB0fcj1MfMJLRdoGjtoNJiA4QplUQ 9ZgLIyPpvvfEn/Fs1P1WTtd11xKAUOnpd0Gyi6kfU1RlSuJKSo3+thFVm+bTqMUKxM6u wFEyHCgy0svVm7tk+rL515gskaPnwnaNYlK1sC3l2A513tgrdWjkdcRad9Q6C+3l9asA 6JTw== X-Gm-Message-State: AOJu0YweOjoFYo00snbTtitHFC9bOo+CkAh2iV9mNND4QEwBfLtQGVfz MfIrkN2FrNXI5bB0NReS+eAkJ1FCg18r5qTlsZ+QhW5v3Y0YssAEO+VBKOg9vhxa4/dN1FzbtIk nuOU+oA== X-Google-Smtp-Source: AGHT+IE2JzQP3YDsudqrkKBKctPz5ZJzYYsslGXvmJnnuJTqMHDtLOINXJBhEC09M53+vWt3lvOVdA== X-Received: by 2002:a17:903:2451:b0:20c:5cdd:a91 with SMTP id d9443c01a7336-20e9492f9damr24506215ad.41.1729563284775; Mon, 21 Oct 2024 19:14:44 -0700 (PDT) From: yong.huang@smartx.com To: qemu-devel@nongnu.org Cc: Peter Xu , Fabiano Rosas , =?UTF-8?q?Daniel=20P=20=2E=20Berrang=C3=A9?= , yong.huang@smartx.com Subject: [PATCH v3 3/5] guestperf: Support deferred migration for multifd Date: Tue, 22 Oct 2024 10:14:24 +0800 Message-Id: <62b27597177e6c756475bcb95a5e1bc35a998cd3.1729562974.git.yong.huang@smartx.com> X-Mailer: git-send-email 2.27.0 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=2607:f8b0:4864:20::62b; envelope-from=yong.huang@smartx.com; helo=mail-pl1-x62b.google.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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @smartx-com.20230601.gappssmtp.com) X-ZM-MESSAGEID: 1729563359242116600 From: Hyman Huang The way to enable multifd migration has been changed by commit, 82137e6c8c (migration: enforce multifd and postcopy preempt to be set before incoming), and guestperf has not made the necessary changes. If multifd migration had been enabled in the previous manner, the following error would have occurred: Multifd must be set before incoming starts Supporting deferred migration will fix it. Signed-off-by: Hyman Huang Reviewed-by: Daniel P. Berrang=C3=A9 --- scripts/migration/guestperf/engine.py | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/scripts/migration/guestperf/engine.py b/scripts/migration/gues= tperf/engine.py index 608d7270f6..4b15322e8d 100644 --- a/scripts/migration/guestperf/engine.py +++ b/scripts/migration/guestperf/engine.py @@ -106,7 +106,8 @@ def _migrate_progress(self, vm): info.get("dirty-limit-ring-full-time", 0), ) =20 - def _migrate(self, hardware, scenario, src, dst, connect_uri): + def _migrate(self, hardware, scenario, src, + dst, connect_uri, defer_migrate): src_qemu_time =3D [] src_vcpu_time =3D [] src_pid =3D src.get_pid() @@ -220,6 +221,8 @@ def _migrate(self, hardware, scenario, src, dst, connec= t_uri): resp =3D src.cmd("migrate-set-parameters", vcpu_dirty_limit=3Dscenario._vcpu_dirty_limit) =20 + if defer_migrate: + resp =3D dst.cmd("migrate-incoming", uri=3Dconnect_uri) resp =3D src.cmd("migrate", uri=3Dconnect_uri) =20 post_copy =3D False @@ -373,11 +376,14 @@ def _get_common_args(self, hardware, tunnelled=3DFals= e): def _get_src_args(self, hardware): return self._get_common_args(hardware) =20 - def _get_dst_args(self, hardware, uri): + def _get_dst_args(self, hardware, uri, defer_migrate): tunnelled =3D False if self._dst_host !=3D "localhost": tunnelled =3D True argv =3D self._get_common_args(hardware, tunnelled) + + if defer_migrate: + return argv + ["-incoming", "defer"] return argv + ["-incoming", uri] =20 @staticmethod @@ -424,6 +430,7 @@ def _get_timings(self, vm): =20 def run(self, hardware, scenario, result_dir=3Dos.getcwd()): abs_result_dir =3D os.path.join(result_dir, scenario._name) + defer_migrate =3D False =20 if self._transport =3D=3D "tcp": uri =3D "tcp:%s:9000" % self._dst_host @@ -439,6 +446,9 @@ def run(self, hardware, scenario, result_dir=3Dos.getcw= d()): except: pass =20 + if scenario._multifd: + defer_migrate =3D True + if self._dst_host !=3D "localhost": dstmonaddr =3D ("localhost", 9001) else: @@ -452,7 +462,7 @@ def run(self, hardware, scenario, result_dir=3Dos.getcw= d()): monitor_address=3Dsrcmonaddr) =20 dst =3D QEMUMachine(self._binary, - args=3Dself._get_dst_args(hardware, uri), + args=3Dself._get_dst_args(hardware, uri, defer_m= igrate), wrapper=3Dself._get_dst_wrapper(hardware), name=3D"qemu-dst-%d" % os.getpid(), monitor_address=3Ddstmonaddr) @@ -461,7 +471,8 @@ def run(self, hardware, scenario, result_dir=3Dos.getcw= d()): src.launch() dst.launch() =20 - ret =3D self._migrate(hardware, scenario, src, dst, uri) + ret =3D self._migrate(hardware, scenario, src, + dst, uri, defer_migrate) progress_history =3D ret[0] qemu_timings =3D ret[1] vcpu_timings =3D ret[2] --=20 2.27.0