From nobody Wed Oct 23 00:24:49 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=1729276005; cv=none; d=zohomail.com; s=zohoarc; b=Kpq9rkgNEHp/fVmWq4Yt60iju1bF5jt0z9u4p7oD8AcdA2yARj8WCDcmKQuAj1+qVb2nqWmV5gFv9fKhZRZxzwe8e6ZibwY93q871LaPb6Xd7LiqfVgy7zEnyk+1YTWsfB4y0hmJyiux5ZhoqUO0/02ifhZh9u0J0FCAs8pGIEY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1729276005; h=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=f4rXhcsu75RQ6qJ8BqPK5pJGFSBb9OK02xFD1ELB+RE=; b=YJlwLXMlAKxa2ffFwIpQkrYAT7neH2bdrhVXPgVeY2k9YUNkkLqSBvJEKUQdONQp94n/MD8QaJSHrxnLx7FZNR7gN+f0sexhOwwB1cnJPmwzQD23Ma7sEBAUQP841DYEpV2Qu6krrApysNYIK4mdNsNkIEf+fZhRp2sra8plwZg= 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 1729276005377680.8672442550591; Fri, 18 Oct 2024 11:26:45 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t1rfG-0005RB-Ce; Fri, 18 Oct 2024 14:25:30 -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 1t1rfA-0005PX-Oz for qemu-devel@nongnu.org; Fri, 18 Oct 2024 14:25:25 -0400 Received: from mail-pl1-x632.google.com ([2607:f8b0:4864:20::632]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t1rf8-0001zY-Kb for qemu-devel@nongnu.org; Fri, 18 Oct 2024 14:25:24 -0400 Received: by mail-pl1-x632.google.com with SMTP id d9443c01a7336-20cb7139d9dso22957785ad.1 for ; Fri, 18 Oct 2024 11:25:21 -0700 (PDT) Received: from localhost.localdomain ([118.114.60.204]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-20e5a8f2034sm15668475ad.193.2024.10.18.11.25.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Oct 2024 11:25:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=smartx-com.20230601.gappssmtp.com; s=20230601; t=1729275920; x=1729880720; 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=f4rXhcsu75RQ6qJ8BqPK5pJGFSBb9OK02xFD1ELB+RE=; b=cHgUb1eLYJMUSx2Kd7C4fdQjqAVDVrwsJ97CQKYMSSUqntm8enpzYJH1KawXiBFSmy IJzxyvGqxQ452RnON5kRTzshxgXQmRBHfKmnM4m8Fq4lpxRV8KlppfOoxqSvT4DJuru3 IMrp7a8YN1EQGY32kQlAWBLhMmFzDwGNJfG7qXnQOwjGujk00DZ30sKCrfK+YYg+xd25 g3kCMnYiBLOZBHJSbheOG5y9tCEbB9RDG+MH50NV1AyWzCj7R5xL4ZHtlDrmZ5aEIFkr IIX3yEpdFsqFhYj0qJI/GThjPyXoX/jt+gPGZnzDf4pXClzr7TX7EmcZsiqipYG4mEnX ebiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729275920; x=1729880720; 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=f4rXhcsu75RQ6qJ8BqPK5pJGFSBb9OK02xFD1ELB+RE=; b=Cupr1rIy+Fkaa8p2BNHd3NC6vlfJn/xvx94Ptt08WY1V0Sw3muJVt7xlQ4mNnVFOUs Qh/uRG2lb1Z1jpDGiABRuH79Ex+Ic0KyBUXnAsf1zGfA+mYEsO75sHDcezWYPYaCaMFW b4pOtkGuyG/9Vr60n79lADWFF5D0ONySr6yWNGwUP2cl5SfxhVIgSkoHY8hvSrKjaXK/ wYXGr1AVM7JtO+pqAnPXaAZW5kBlFKP/64l7Pyf9ekudQMH2T6Z9807X4AAS+JmDlMiZ 8nQs3SmnQlM5f/qleDZ5PqlxnugsvKE7UhW1Pz+l0iH1DZaJVpgoi2Yh4LRKJMcigQgv gvwA== X-Gm-Message-State: AOJu0Yzieru8mFxkhcHSUQrlE8/rqAo5u5csUNL4KR8EyG7XRIyXXX9v Ehnda9w34QZBnWCRh+PcgX/3ObOAiLJIGQqoUD0RhLkecHlZMOuCBBtDgCmoTtKm8hsIA7bdLUP f5OP9sg== X-Google-Smtp-Source: AGHT+IHNTFlA64Z7438lRC4Dm5QySlOViy66H5y9G5fD6p1xhtovSIoPEcjgIUAUeUvLJ1AcJXa4EQ== X-Received: by 2002:a17:902:db04:b0:20e:5997:c107 with SMTP id d9443c01a7336-20e5a8fb320mr45380465ad.39.1729275919607; Fri, 18 Oct 2024 11:25:19 -0700 (PDT) From: Hyman Huang 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 v2 3/5] guestperf: Support deferred migration for multifd Date: Sat, 19 Oct 2024 02:25:05 +0800 Message-Id: X-Mailer: git-send-email 2.39.1 In-Reply-To: References: MIME-Version: 1.0 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::632; envelope-from=yong.huang@smartx.com; helo=mail-pl1-x632.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: 1729276006211116600 Content-Type: text/plain; charset="utf-8" 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.39.1