From patchwork Tue Oct 22 02:14:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Yong Huang X-Patchwork-Id: 13845002 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3390AD17159 for ; Tue, 22 Oct 2024 02:16:00 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t34Q4-0005w6-77; Mon, 21 Oct 2024 22:14:48 -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 1t34Q1-0005vB-RM for qemu-devel@nongnu.org; Mon, 21 Oct 2024 22:14:45 -0400 Received: from mail-pj1-x1034.google.com ([2607:f8b0:4864:20::1034]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t34Pz-0001Wi-Ku for qemu-devel@nongnu.org; Mon, 21 Oct 2024 22:14:45 -0400 Received: by mail-pj1-x1034.google.com with SMTP id 98e67ed59e1d1-2e31af47681so4056138a91.2 for ; Mon, 21 Oct 2024 19:14:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=smartx-com.20230601.gappssmtp.com; s=20230601; t=1729563282; x=1730168082; 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=sVA3h8dGHcJJcPtq0zM3qZ8s881zYIxPG4Jh2pmOWt8=; b=S+xCVywvJ3/w4fMH57VS0yRNSYKV4Dhg5giX53yMYjDEwYpc7iu30PqhRJ9x7szjH+ ikO6q31g8obaCHRJlJZLbfD/nJsNO+izCOdLfIoug6leEmBDGmi05Qw7iy4YcbsgKUmr 3cOtwRv6oke6TCvslVSdxArXLDwTfi95/XA2iOZ1cSWTfjWtwH3qEoBA6GcCreUIphMv 4OTDemme8FVJIyRRhnrPdq4NH2AUSoKpNnsxxylW8XmREZQPuJOjuUD2z5AsuAZb7xhJ dp28K0j0UmPls5zfW7OXDsTx5R7XulT0OtmpbkYbTxJFCVLcJlx6y//zPyX9ugLHeYlu w01w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729563282; x=1730168082; 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=sVA3h8dGHcJJcPtq0zM3qZ8s881zYIxPG4Jh2pmOWt8=; b=dZRLgMgNotpYdQkA2qn0sYEuwUmnQYT4kQ4RNe2ymYE8PKvAnUciRM5oqTzS2bHili TsuTZowt+sQ9+EQaUpD0t2wdiQ3a5tsouINf+lwANrh+2G6PwYsRp+An10yTlB9MvtQ1 h3qeIdyPBuwUknN9aLrOJEDehYUXI9BsGpWqgDHJW7YOD114kSOFusbtsr6dOEsKCGDn 28Kp0VM+XPhAvYSNi9Ys26O/D53pSC6pMHzPORrgd3MqqW4V5Yc0ruUVrWm5zCp2ZB6Z kE8hLoS84lcheC6e8Cx7KLB9GCfADFUpEAb9w7/6tHjDqMH+Qc93aT+BtpkOWE6+AcU3 liiA== X-Gm-Message-State: AOJu0YyTcft2NDB27MUybFn3uSG5ZT16f87wLLArT1l5XQ989h/C/rU7 lXR302JuZziwREGhu49ueb14WAG5ouWLlK4CuLTpuwyh81PVgW+62BeAzwcnHvb15dHRX/Kdgks D3JS0Gw== X-Google-Smtp-Source: AGHT+IEFp6ES0EJ9Ic3b/aaPxATEdFUK8XSINx3nS9axZTxRJCfOoTsA06Hu0NzXL6l7o8Xq4M86LQ== X-Received: by 2002:a17:90a:4e0b:b0:2e5:e33c:99c5 with SMTP id 98e67ed59e1d1-2e5e33c9a62mr276073a91.37.1729563281072; Mon, 21 Oct 2024 19:14:41 -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.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Oct 2024 19:14:40 -0700 (PDT) From: yong.huang@smartx.com To: qemu-devel@nongnu.org Cc: Peter Xu , Fabiano Rosas , =?utf-8?q?Daniel_P_=2E_Berrang=C3=A9?= , yong.huang@smartx.com Subject: [PATCH v3 1/5] tests/migration: Move the guestperf tool to scripts directory Date: Tue, 22 Oct 2024 10:14:22 +0800 Message-Id: X-Mailer: git-send-email 2.27.0 In-Reply-To: References: MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1034; envelope-from=yong.huang@smartx.com; helo=mail-pj1-x1034.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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org From: Hyman Huang Guestperf was designed to test the performance of migration, with a loose connection to the fundamental test cases of QEMU. To improve the repository's structure, move it to the scripts directory. Add myself as a maintainer for the guestperf so that I can help to fix bugs. Signed-off-by: Hyman Huang Reviewed-by: Daniel P. Berrangé Reviewed-by: Prasad Pandit --- MAINTAINERS | 5 +++++ {tests => scripts}/migration/guestperf-batch.py | 0 {tests => scripts}/migration/guestperf-plot.py | 0 {tests => scripts}/migration/guestperf.py | 0 {tests => scripts}/migration/guestperf/__init__.py | 0 {tests => scripts}/migration/guestperf/comparison.py | 0 {tests => scripts}/migration/guestperf/engine.py | 0 {tests => scripts}/migration/guestperf/hardware.py | 0 {tests => scripts}/migration/guestperf/plot.py | 0 {tests => scripts}/migration/guestperf/progress.py | 0 {tests => scripts}/migration/guestperf/report.py | 0 {tests => scripts}/migration/guestperf/scenario.py | 0 {tests => scripts}/migration/guestperf/shell.py | 0 {tests => scripts}/migration/guestperf/timings.py | 0 14 files changed, 5 insertions(+) rename {tests => scripts}/migration/guestperf-batch.py (100%) rename {tests => scripts}/migration/guestperf-plot.py (100%) rename {tests => scripts}/migration/guestperf.py (100%) rename {tests => scripts}/migration/guestperf/__init__.py (100%) rename {tests => scripts}/migration/guestperf/comparison.py (100%) rename {tests => scripts}/migration/guestperf/engine.py (100%) rename {tests => scripts}/migration/guestperf/hardware.py (100%) rename {tests => scripts}/migration/guestperf/plot.py (100%) rename {tests => scripts}/migration/guestperf/progress.py (100%) rename {tests => scripts}/migration/guestperf/report.py (100%) rename {tests => scripts}/migration/guestperf/scenario.py (100%) rename {tests => scripts}/migration/guestperf/shell.py (100%) rename {tests => scripts}/migration/guestperf/timings.py (100%) diff --git a/MAINTAINERS b/MAINTAINERS index c21d6a2f9e..c7938c397c 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -3403,6 +3403,11 @@ F: migration/dirtyrate.h F: include/sysemu/dirtyrate.h F: docs/devel/migration/dirty-limit.rst +Migration performance test tool +M: Hyman Huang +S: Maintained +F: scripts/migration/guestperf* + Detached LUKS header M: Hyman Huang S: Maintained diff --git a/tests/migration/guestperf-batch.py b/scripts/migration/guestperf-batch.py similarity index 100% rename from tests/migration/guestperf-batch.py rename to scripts/migration/guestperf-batch.py diff --git a/tests/migration/guestperf-plot.py b/scripts/migration/guestperf-plot.py similarity index 100% rename from tests/migration/guestperf-plot.py rename to scripts/migration/guestperf-plot.py diff --git a/tests/migration/guestperf.py b/scripts/migration/guestperf.py similarity index 100% rename from tests/migration/guestperf.py rename to scripts/migration/guestperf.py diff --git a/tests/migration/guestperf/__init__.py b/scripts/migration/guestperf/__init__.py similarity index 100% rename from tests/migration/guestperf/__init__.py rename to scripts/migration/guestperf/__init__.py diff --git a/tests/migration/guestperf/comparison.py b/scripts/migration/guestperf/comparison.py similarity index 100% rename from tests/migration/guestperf/comparison.py rename to scripts/migration/guestperf/comparison.py diff --git a/tests/migration/guestperf/engine.py b/scripts/migration/guestperf/engine.py similarity index 100% rename from tests/migration/guestperf/engine.py rename to scripts/migration/guestperf/engine.py diff --git a/tests/migration/guestperf/hardware.py b/scripts/migration/guestperf/hardware.py similarity index 100% rename from tests/migration/guestperf/hardware.py rename to scripts/migration/guestperf/hardware.py diff --git a/tests/migration/guestperf/plot.py b/scripts/migration/guestperf/plot.py similarity index 100% rename from tests/migration/guestperf/plot.py rename to scripts/migration/guestperf/plot.py diff --git a/tests/migration/guestperf/progress.py b/scripts/migration/guestperf/progress.py similarity index 100% rename from tests/migration/guestperf/progress.py rename to scripts/migration/guestperf/progress.py diff --git a/tests/migration/guestperf/report.py b/scripts/migration/guestperf/report.py similarity index 100% rename from tests/migration/guestperf/report.py rename to scripts/migration/guestperf/report.py diff --git a/tests/migration/guestperf/scenario.py b/scripts/migration/guestperf/scenario.py similarity index 100% rename from tests/migration/guestperf/scenario.py rename to scripts/migration/guestperf/scenario.py diff --git a/tests/migration/guestperf/shell.py b/scripts/migration/guestperf/shell.py similarity index 100% rename from tests/migration/guestperf/shell.py rename to scripts/migration/guestperf/shell.py diff --git a/tests/migration/guestperf/timings.py b/scripts/migration/guestperf/timings.py similarity index 100% rename from tests/migration/guestperf/timings.py rename to scripts/migration/guestperf/timings.py From patchwork Tue Oct 22 02:14:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Yong Huang X-Patchwork-Id: 13845000 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C47A6D17157 for ; Tue, 22 Oct 2024 02:15:43 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t34Q4-0005w8-9L; Mon, 21 Oct 2024 22:14:48 -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 1t34Q2-0005vO-Nn for qemu-devel@nongnu.org; Mon, 21 Oct 2024 22:14:46 -0400 Received: from mail-pg1-x531.google.com ([2607:f8b0:4864:20::531]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t34Q1-0001Wq-49 for qemu-devel@nongnu.org; Mon, 21 Oct 2024 22:14:46 -0400 Received: by mail-pg1-x531.google.com with SMTP id 41be03b00d2f7-7eb0bc007edso30099a12.3 for ; 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=1729563283; x=1730168083; 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=W5MvZfZJ1w+4jWoKSy1g+C8Ivvk/AddqkyL7u9uzph4=; b=lPU5yoeQOO6zwtnLcmgOv6RGaNAHh0BrgtmkN3qJoKFw060w2rr12Nnlz2iNJebhFD 6MKcEud4OgRtFZf24cwHSyor/7cAU57MOl48T2KTOigZidnCp4RmDSncRMXM9N3YFsSH jR1dO7goELGgB/KgCJ5GJPnCojdq/EPZtIAqK/zZo6pUvbFI5nauIX+2zc57nABtVKUK Wbnm0o+pRnKEFpj13AaT0pMicHnihoKCclMOM71WTGy/P4QlrtNQtzNNBXC0Eg2zt+8d sQ8HFrTJCdyt+Bnv4ixxDj4WA5ZTReWGmuypLe9qQ1uQlIOsVgTuMzNl783bb8kSlzIW n6ZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729563283; x=1730168083; 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=W5MvZfZJ1w+4jWoKSy1g+C8Ivvk/AddqkyL7u9uzph4=; b=gEF5wky7X+l+b1GRS3obCtElceOS5FHk+lmEUBIB1jU73ariOSI+I57yXS+1npDUGB ne8YxzayQikbI/fY+7b923BK58ovCwh7DQQ+j2LvkKDSzeAHNbl2gVgdJi7D/Yc4Q1u+ 1/lvDjRKzqlitZWHyA5LdmPWhVQTvzi7HKb1Xfw3uQTijp1nYqxB1cnLllM12sZBRyVH sGXDVaBOvjoPj2GYfUejGYyUyvntn2HMz8hhjGjNmsNDcmTXIdOzkMWcpXgzBXDVFZBr xcW3316WJdVUzvv3MT87Yidz+Z+AIcdU849CIDH0IQegz6alzGePITWoFvjDkaZEkMGX kCLg== X-Gm-Message-State: AOJu0YzLLLSmnQPxi9BzSL9D93WLitC7NXfuWQBC/ARxDIUFPLS2fI// nkcJAIQu8h1T/mimxOJI7XRqtfAWr9hq4TaqXewo9fFNNeEZuct9gWEQ8khd2fo5jP0PlI7Dvif FuMkTSA== X-Google-Smtp-Source: AGHT+IENuVTNXjHICjhlAVrfJZrJ6dYjOmJ/DjzyWdC0koxZVln6NeZFXsl3SeQE82G6xu8LLtkFXw== X-Received: by 2002:a05:6a20:d795:b0:1d9:252f:a063 with SMTP id adf61e73a8af0-1d96dece061mr1204868637.25.1729563282891; Mon, 21 Oct 2024 19:14:42 -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.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Oct 2024 19:14:42 -0700 (PDT) From: yong.huang@smartx.com To: qemu-devel@nongnu.org Cc: Peter Xu , Fabiano Rosas , =?utf-8?q?Daniel_P_=2E_Berrang=C3=A9?= , yong.huang@smartx.com Subject: [PATCH v3 2/5] tests/migration: Make initrd-stress.img built by default Date: Tue, 22 Oct 2024 10:14:23 +0800 Message-Id: <712b58440ee6a2cfae925978276171553dbae1eb.1729562974.git.yong.huang@smartx.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: References: MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::531; envelope-from=yong.huang@smartx.com; helo=mail-pg1-x531.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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org From: Hyman Huang The initrd-stress.img was compiled by specifying the target, to make it easier for developers to play the guestperf tool, make it built when dependencies suffices. Signed-off-by: Hyman Huang Reviewed-by: Daniel P. Berrangé --- tests/migration/meson.build | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/tests/migration/meson.build b/tests/migration/meson.build index a91aa61c65..e10acbe317 100644 --- a/tests/migration/meson.build +++ b/tests/migration/meson.build @@ -2,17 +2,21 @@ sysprof = dependency('sysprof-capture-4', method: 'pkg-config', required: false) glib_static = dependency('glib-2.0', version: glib_req_ver, required: false, method: 'pkg-config', static: true) -stress = executable( - 'stress', - files('stress.c'), - dependencies: [glib_static, sysprof], - link_args: ['-static'], - build_by_default: false, -) -custom_target( - 'initrd-stress.img', - output: 'initrd-stress.img', - input: stress, - command: [find_program('initrd-stress.sh'), '@OUTPUT@', '@INPUT@'] -) +if host_os == 'linux' and sysprof.found() and glib_static.found() + stress = executable( + 'stress', + files('stress.c'), + dependencies: [glib_static, sysprof], + link_args: ['-static'], + ) + + custom_target( + 'initrd-stress.img', + output: 'initrd-stress.img', + input: stress, + command: [find_program('initrd-stress.sh'), '@OUTPUT@', '@INPUT@'], + build_by_default: true, + depends: [stress], + ) +endif From patchwork Tue Oct 22 02:14:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Yong Huang X-Patchwork-Id: 13845001 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 094EBD17159 for ; Tue, 22 Oct 2024 02:15:57 +0000 (UTC) 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) 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) 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) From: yong.huang@smartx.com To: qemu-devel@nongnu.org Cc: Peter Xu , Fabiano Rosas , =?utf-8?q?Daniel_P_=2E_Berrang=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 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org 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é --- scripts/migration/guestperf/engine.py | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/scripts/migration/guestperf/engine.py b/scripts/migration/guestperf/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), ) - def _migrate(self, hardware, scenario, src, dst, connect_uri): + def _migrate(self, hardware, scenario, src, + dst, connect_uri, defer_migrate): src_qemu_time = [] src_vcpu_time = [] src_pid = src.get_pid() @@ -220,6 +221,8 @@ def _migrate(self, hardware, scenario, src, dst, connect_uri): resp = src.cmd("migrate-set-parameters", vcpu_dirty_limit=scenario._vcpu_dirty_limit) + if defer_migrate: + resp = dst.cmd("migrate-incoming", uri=connect_uri) resp = src.cmd("migrate", uri=connect_uri) post_copy = False @@ -373,11 +376,14 @@ def _get_common_args(self, hardware, tunnelled=False): def _get_src_args(self, hardware): return self._get_common_args(hardware) - def _get_dst_args(self, hardware, uri): + def _get_dst_args(self, hardware, uri, defer_migrate): tunnelled = False if self._dst_host != "localhost": tunnelled = True argv = self._get_common_args(hardware, tunnelled) + + if defer_migrate: + return argv + ["-incoming", "defer"] return argv + ["-incoming", uri] @staticmethod @@ -424,6 +430,7 @@ def _get_timings(self, vm): def run(self, hardware, scenario, result_dir=os.getcwd()): abs_result_dir = os.path.join(result_dir, scenario._name) + defer_migrate = False if self._transport == "tcp": uri = "tcp:%s:9000" % self._dst_host @@ -439,6 +446,9 @@ def run(self, hardware, scenario, result_dir=os.getcwd()): except: pass + if scenario._multifd: + defer_migrate = True + if self._dst_host != "localhost": dstmonaddr = ("localhost", 9001) else: @@ -452,7 +462,7 @@ def run(self, hardware, scenario, result_dir=os.getcwd()): monitor_address=srcmonaddr) dst = QEMUMachine(self._binary, - args=self._get_dst_args(hardware, uri), + args=self._get_dst_args(hardware, uri, defer_migrate), wrapper=self._get_dst_wrapper(hardware), name="qemu-dst-%d" % os.getpid(), monitor_address=dstmonaddr) @@ -461,7 +471,8 @@ def run(self, hardware, scenario, result_dir=os.getcwd()): src.launch() dst.launch() - ret = self._migrate(hardware, scenario, src, dst, uri) + ret = self._migrate(hardware, scenario, src, + dst, uri, defer_migrate) progress_history = ret[0] qemu_timings = ret[1] vcpu_timings = ret[2] From patchwork Tue Oct 22 02:14:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Yong Huang X-Patchwork-Id: 13844999 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4D5CAD17157 for ; Tue, 22 Oct 2024 02:15:26 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t34Q9-0005xU-2g; Mon, 21 Oct 2024 22:14:53 -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 1t34Q6-0005x5-UI for qemu-devel@nongnu.org; Mon, 21 Oct 2024 22:14:50 -0400 Received: from mail-pl1-x62c.google.com ([2607:f8b0:4864:20::62c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t34Q5-0001Xu-DQ for qemu-devel@nongnu.org; Mon, 21 Oct 2024 22:14:50 -0400 Received: by mail-pl1-x62c.google.com with SMTP id d9443c01a7336-20c767a9c50so47375565ad.1 for ; Mon, 21 Oct 2024 19:14:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=smartx-com.20230601.gappssmtp.com; s=20230601; t=1729563287; x=1730168087; 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=Zo+RtlxJE/Vyu5z39LEZBU3bTp7nPUEFJlDoFBaiCLQ=; b=Ajhe2szO4SGNPdQTdTlOi6bBCcHByl30e+k3qmerRurfksGtIA7IO6NDRM8gOqAfqx OiwaZt0nJpl1GPhLh9P6gXRujx8yxBgadNONDoAOSk6EMQ+QchfG6vNIPiyAmCrs76sj x5VtkansJEM/DQudV4X4eQaKu5cI4PKpQOeX8nI5M4iU0PeAtlsafKtXLx0+SR+27s+M oPhsKM80+wv21qkghihV2A3K0O+R85kAYfn5EpNcSJblJGX6Ypzk/rFT3Eoe0PJqPb5m 2L2bzPJMgDa7DqFUN9nIR4DdA2/TW2STfJdMVKzEnVw9QqxAMCM2WFcOyjArwJ2jyaWO PwwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729563287; x=1730168087; 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=Zo+RtlxJE/Vyu5z39LEZBU3bTp7nPUEFJlDoFBaiCLQ=; b=XrGF3uir59Q5yiLNJiw9fmJjbXzqm3Q9JxFHec+yWXClYAjKxCTAu0BiVfVYhQMGER uYqaDBqMkCssjJaRiYDY++viXTcG8zKJRiMc/9qBaP97Z23+pW7OFN7SuGQZfr3nwBbR gScvYGuor9bDCaW6d2DOFHN5BamQtpI5NT7F81At8WSVTXeKyRpfA5dj//YHIGcsqFWZ /kL+E1Rj8dpZ49ZgP0e/S9JqJCi0L7vD5Hx+dKAxV2chSduZnligLm7tLHt/W/e5EVJO 2xmHvzbnWOjJ1BJp8OIApxWxYiufSwqc3P5LGXbX8UcVoJq2lOIpHHDLqIvWMEcLI/bs qqbQ== X-Gm-Message-State: AOJu0Yy1hfoJ0klHy6EUMymha1karmJ+fU0zNxh6qFY/Zc3FvAZHfFRi NxOX2JVgWmMwGUgoQBZopxWUx4s0ZE52wjU+s62DV7UX0Szww4wxw16LR86xdpLHAeODfZFRWnA Jv5Ck2Q== X-Google-Smtp-Source: AGHT+IFkmHnl0YIw8XivFFVe6tv2y88tYsfLMqv2zd/Cffit5vAjqxkkuQRwJvyN6jkxPiYcEYXuRQ== X-Received: by 2002:a17:902:da8f:b0:20c:6392:1a7b with SMTP id d9443c01a7336-20e5a736ff0mr194222415ad.2.1729563286811; 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.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Oct 2024 19:14:46 -0700 (PDT) From: yong.huang@smartx.com To: qemu-devel@nongnu.org Cc: Peter Xu , Fabiano Rosas , =?utf-8?q?Daniel_P_=2E_Berrang=C3=A9?= , yong.huang@smartx.com Subject: [PATCH v3 4/5] guestperf: Nitpick the inconsistent parameters Date: Tue, 22 Oct 2024 10:14:25 +0800 Message-Id: <4a243c2b8a5dc8baa689dc94e96a6ab3372f1644.1729562974.git.yong.huang@smartx.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: References: MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62c; envelope-from=yong.huang@smartx.com; helo=mail-pl1-x62c.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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org From: Hyman Huang Signed-off-by: Hyman Huang Reviewed-by: Fabiano Rosas Reviewed-by: Daniel P. Berrangé --- scripts/migration/guestperf/comparison.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/migration/guestperf/comparison.py b/scripts/migration/guestperf/comparison.py index 42cc0372d1..40e9d2eb1d 100644 --- a/scripts/migration/guestperf/comparison.py +++ b/scripts/migration/guestperf/comparison.py @@ -127,7 +127,7 @@ def __init__(self, name, scenarios): # varying numbers of channels Comparison("compr-multifd", scenarios = [ Scenario("compr-multifd-channels-4", - multifd=True, multifd_channels=2), + multifd=True, multifd_channels=4), Scenario("compr-multifd-channels-8", multifd=True, multifd_channels=8), Scenario("compr-multifd-channels-32", From patchwork Tue Oct 22 02:14:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Yong Huang X-Patchwork-Id: 13844998 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E9DB4D17159 for ; Tue, 22 Oct 2024 02:15:17 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t34Q9-0005xg-MY; Mon, 21 Oct 2024 22:14:53 -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 1t34Q8-0005xY-OQ for qemu-devel@nongnu.org; Mon, 21 Oct 2024 22:14:52 -0400 Received: from mail-pl1-x62d.google.com ([2607:f8b0:4864:20::62d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t34Q7-0001YG-0E for qemu-devel@nongnu.org; Mon, 21 Oct 2024 22:14:52 -0400 Received: by mail-pl1-x62d.google.com with SMTP id d9443c01a7336-20cb47387ceso45381085ad.1 for ; Mon, 21 Oct 2024 19:14:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=smartx-com.20230601.gappssmtp.com; s=20230601; t=1729563289; x=1730168089; 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=lKvuj5hWnr5GBGkIVkR3iyQz24UtRbahAZ35LrK2uoY=; b=APO0QSv1s6ScGy9y9I1+uqLUMP7+UpKl7V/9LYW9LWyRe134XdJy+EHP0GHXhEhS63 xrnrWKgUwtF61xkfdsYxHllg3VKmzLPLaHZt1L1tp3BEAJY107DdAsgI0e4kn5T57jb6 V/HPhGFCIaa164TNzf/qp3rZn6w8vRntYFZNpJRkSGs5b1WkM+km11JBdhXw246GaoLe PFEaSISHM8rXqgLQErkc48D7S8qUsYWgCZBBYpM0ZGtM/tn8YXkJWjdN2Zs8U7DEobVS bEYXpk2uEic8m9ouy3mfM0hp1+93B4xKui1QFeiZI4OF5Hcsdt6kqWphyuXlBrIuUIC/ yqFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729563289; x=1730168089; 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=lKvuj5hWnr5GBGkIVkR3iyQz24UtRbahAZ35LrK2uoY=; b=GZRnQXqF7qfeDGLlZ4vyLreLZQt4xnoOxHOwGSbaRztW8I/4+nDXuQqQKVnCuWSUZP qBJe6jRAuRFQluEDxyaiTEjyUIWVB3EU14xP7jefBKg/8Y++tlqqsDPcbvVvgQ8F+Y+4 gYYNXKPlQXNScBT5KMsjyMHjz1w0ql64PspZ8V9oDMwad0eBH7QyQQzGlbXDXAMC2MGH IbJtID8L20+HtiSk3GdxCqw2xR9ZBjzJw6cv/IrOV7xhSd2L+tgutVlayfYOPM6DFQU5 TckkdUJLxS8t0JmCwZn1zMqEcmSkz/iyNBpZpgS40C1o8QuurA93pc2MkM7Zau74rw34 7FlQ== X-Gm-Message-State: AOJu0YwadLA5+OTg+ZaMw6SSTBDPZ6Tg6pVn+SrAn/Akuw44rpZkMZ9R UWuw3xmN30y5pO4bpzegR5jJOPkw3xcmzyaZCkgFC0YAU5rLPhGQnoERVJcLhdtr74zs03sGEs9 oMqNmAA== X-Google-Smtp-Source: AGHT+IEN5aCcckZf6y8wKLRPkS/feHXlDLngYAQsMgVQvxughZJjj80y3tjn7JcPTXz6F2f1GDnePg== X-Received: by 2002:a17:902:ced2:b0:20c:c694:f6c6 with SMTP id d9443c01a7336-20e5a927e6bmr136070235ad.49.1729563288679; Mon, 21 Oct 2024 19:14:48 -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.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Oct 2024 19:14:48 -0700 (PDT) From: yong.huang@smartx.com To: qemu-devel@nongnu.org Cc: Peter Xu , Fabiano Rosas , =?utf-8?q?Daniel_P_=2E_Berrang=C3=A9?= , yong.huang@smartx.com Subject: [PATCH v3 5/5] guestperf: Introduce multifd compression option Date: Tue, 22 Oct 2024 10:14:26 +0800 Message-Id: <89b191beabd6ce778e5ae4756937f589b5261099.1729562974.git.yong.huang@smartx.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: References: MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62d; envelope-from=yong.huang@smartx.com; helo=mail-pl1-x62d.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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org From: Hyman Huang Guestperf tool does not cover the multifd compression option currently, it is worth supporting so that developers can analysis the migration performance with different compression algorithms. Multifd support 4 compression algorithms currently: zlib, zstd, qpl, uadk To request that multifd with the specified compression algorithm such as zlib: $ ./scripts/migration/guestperf.py \ --multifd --multifd-channels 4 --multifd-compression zlib \ --output output.json To run the entire standardized set of multifd compression comparisons, with unix migration: $ ./scripts/migration/guestperf-batch.py \ --dst-host localhost --transport unix \ --filter compr-multifd-compression* --output outputdir Signed-off-by: Hyman Huang Reviewed-by: Daniel P. Berrangé --- scripts/migration/guestperf/comparison.py | 13 +++++++++++++ scripts/migration/guestperf/engine.py | 14 ++++++++++++++ scripts/migration/guestperf/scenario.py | 7 +++++-- scripts/migration/guestperf/shell.py | 3 +++ 4 files changed, 35 insertions(+), 2 deletions(-) diff --git a/scripts/migration/guestperf/comparison.py b/scripts/migration/guestperf/comparison.py index 40e9d2eb1d..dee3ac25e4 100644 --- a/scripts/migration/guestperf/comparison.py +++ b/scripts/migration/guestperf/comparison.py @@ -158,4 +158,17 @@ def __init__(self, name, scenarios): Scenario("compr-dirty-limit-50MB", dirty_limit=True, vcpu_dirty_limit=50), ]), + + # Looking at effect of multifd with + # different compression algorithms + Comparison("compr-multifd-compression", scenarios = [ + Scenario("compr-multifd-compression-zlib", + multifd=True, multifd_channels=2, multifd_compression="zlib"), + Scenario("compr-multifd-compression-zstd", + multifd=True, multifd_channels=2, multifd_compression="zstd"), + Scenario("compr-multifd-compression-qpl", + multifd=True, multifd_channels=2, multifd_compression="qpl"), + Scenario("compr-multifd-compression-uadk", + multifd=True, multifd_channels=2, multifd_compression="uadk"), + ]), ] diff --git a/scripts/migration/guestperf/engine.py b/scripts/migration/guestperf/engine.py index 4b15322e8d..e11f6a8496 100644 --- a/scripts/migration/guestperf/engine.py +++ b/scripts/migration/guestperf/engine.py @@ -31,6 +31,8 @@ '..', '..', '..', 'python')) from qemu.machine import QEMUMachine +# multifd supported compression algorithms +MULTIFD_CMP_ALGS = ("zlib", "zstd", "qpl", "uadk") class Engine(object): @@ -191,6 +193,12 @@ def _migrate(self, hardware, scenario, src, scenario._compression_xbzrle_cache)) if scenario._multifd: + if (scenario._multifd_compression and + (scenario._multifd_compression not in MULTIFD_CMP_ALGS)): + raise Exception("unsupported multifd compression " + "algorithm: %s" % + scenario._multifd_compression) + resp = src.cmd("migrate-set-capabilities", capabilities = [ { "capability": "multifd", @@ -206,6 +214,12 @@ def _migrate(self, hardware, scenario, src, resp = dst.cmd("migrate-set-parameters", multifd_channels=scenario._multifd_channels) + if scenario._multifd_compression: + resp = src.cmd("migrate-set-parameters", + multifd_compression=scenario._multifd_compression) + resp = dst.cmd("migrate-set-parameters", + multifd_compression=scenario._multifd_compression) + if scenario._dirty_limit: if not hardware._dirty_ring_size: raise Exception("dirty ring size must be configured when " diff --git a/scripts/migration/guestperf/scenario.py b/scripts/migration/guestperf/scenario.py index 154c4f5d5f..4be7fafebf 100644 --- a/scripts/migration/guestperf/scenario.py +++ b/scripts/migration/guestperf/scenario.py @@ -30,7 +30,7 @@ def __init__(self, name, auto_converge=False, auto_converge_step=10, compression_mt=False, compression_mt_threads=1, compression_xbzrle=False, compression_xbzrle_cache=10, - multifd=False, multifd_channels=2, + multifd=False, multifd_channels=2, multifd_compression="", dirty_limit=False, x_vcpu_dirty_limit_period=500, vcpu_dirty_limit=1): @@ -61,6 +61,7 @@ def __init__(self, name, self._multifd = multifd self._multifd_channels = multifd_channels + self._multifd_compression = multifd_compression self._dirty_limit = dirty_limit self._x_vcpu_dirty_limit_period = x_vcpu_dirty_limit_period @@ -85,6 +86,7 @@ def serialize(self): "compression_xbzrle_cache": self._compression_xbzrle_cache, "multifd": self._multifd, "multifd_channels": self._multifd_channels, + "multifd_compression": self._multifd_compression, "dirty_limit": self._dirty_limit, "x_vcpu_dirty_limit_period": self._x_vcpu_dirty_limit_period, "vcpu_dirty_limit": self._vcpu_dirty_limit, @@ -109,4 +111,5 @@ def deserialize(cls, data): data["compression_xbzrle"], data["compression_xbzrle_cache"], data["multifd"], - data["multifd_channels"]) + data["multifd_channels"], + data["multifd_compression"]) diff --git a/scripts/migration/guestperf/shell.py b/scripts/migration/guestperf/shell.py index c85d89efec..1452eb8a33 100644 --- a/scripts/migration/guestperf/shell.py +++ b/scripts/migration/guestperf/shell.py @@ -130,6 +130,8 @@ def __init__(self): action="store_true") parser.add_argument("--multifd-channels", dest="multifd_channels", default=2, type=int) + parser.add_argument("--multifd-compression", dest="multifd_compression", + default="") parser.add_argument("--dirty-limit", dest="dirty_limit", default=False, action="store_true") @@ -166,6 +168,7 @@ def get_scenario(self, args): multifd=args.multifd, multifd_channels=args.multifd_channels, + multifd_compression=args.multifd_compression, dirty_limit=args.dirty_limit, x_vcpu_dirty_limit_period=\