From nobody Sun Nov 24 07:42:53 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 ARC-Seal: i=1; a=rsa-sha256; t=1725892015; cv=none; d=zohomail.com; s=zohoarc; b=MNwcpFkwwDT9yTC0MNmuip9NfpaTfVo5zkHnNzXlZxm48k/gKAnNhFVTqv9SfgLg12W9SHMmGQvL2op0trcTnCzFl4puzrthbtVNVq1sc1bSUzJI0Uka9Q/G9pftuJwl/Hqm32MAdlkan2Jt9W6vamIO7QJ1rCKAj0VVvZ7E+6I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1725892015; 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=3t+rJYL+OLNJsbkNL6rt5vBSdNx9BVxn2HZsRTYOAAc=; b=DG+rVw6QyFFLkZsImOs5+fdqu2odZC/kvmaUEdynoAzsbFaH1IkTZQRfdtMOGcuhx1b87pa0hI7pMdWI2geQnhdTwusFQTM/g9zzoAmx+Xp3yCM0W9QtbsB2prDf0ZNZqZ9n1LHt+l3Yq5pghB2rIz5g70tlCS4X6PH+pevPbZY= 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 17258920157845.067591166716625; Mon, 9 Sep 2024 07:26:55 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1snfLd-0002vl-N2; Mon, 09 Sep 2024 10:26:33 -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 1snfLZ-0002eI-OG for qemu-devel@nongnu.org; Mon, 09 Sep 2024 10:26:31 -0400 Received: from mail-pf1-x42d.google.com ([2607:f8b0:4864:20::42d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1snfLY-0004Vb-06 for qemu-devel@nongnu.org; Mon, 09 Sep 2024 10:26:29 -0400 Received: by mail-pf1-x42d.google.com with SMTP id d2e1a72fcca58-718d704704aso2612035b3a.3 for ; Mon, 09 Sep 2024 07:26:27 -0700 (PDT) Received: from localhost.localdomain ([118.114.94.226]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-718e58b2a88sm3561164b3a.46.2024.09.09.07.26.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Sep 2024 07:26:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=smartx-com.20230601.gappssmtp.com; s=20230601; t=1725891986; x=1726496786; 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=3t+rJYL+OLNJsbkNL6rt5vBSdNx9BVxn2HZsRTYOAAc=; b=Lg8Kck88Wi1Q5i9snlC3be9DG0I7i4UGVn7b63cNg9zTSkkZbazhw9ZxCNB5/OH0L9 6IjT8bRDDVk5b4HNa3L7XxE2ZNYdF+v58Zw3QKSq5IAJTD1/S+vP47tPlYTyNluhFJgp 4JdqpENwwYEOniJkkNaImR9Z6y9Ts7hyJ4lnYdh9g9hmL+zRoGth8txeO0YJ67yVwmN8 Aq44L72yGzlQG2E7bqQPre70/X+wdAUOA8dbdSqxfa5WozOZfxUmoFs11ZqwFDJ/J6Iq 3EwOqTTlbrgRC/ItueQyt3oFFTooAU1MwPbP+yQg8KmmLdZMJAxmeNEO+UL00p6lybAC hx/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725891986; x=1726496786; 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=3t+rJYL+OLNJsbkNL6rt5vBSdNx9BVxn2HZsRTYOAAc=; b=lmj6obVqErqdyy9jNRrEKvcayjVYCuzKHBk5OczvnSz7M+HKt7Q3hmhbCRw1k4HkRA p/01du9gLkfwGSGIrvzgWYviQ+x3WyiUSejFOA/ba7BQRqQkFRNBVSRmVPne5Diwm9qj csYsARmmPhk0nTStpf8FKtwyevRx8mjeec47aObQgsRkDg+HAtGR/8HINTRwsEsugqh5 F90h2odB29sQsK1iV7XSIiLgfivq9h+a7Dz0bnMvjIGYTIDXZKKeAJmJY41R+UOaTGYw c54NLbYzCbljwSmvrepCbfwu4RarmD1okxrdJb0W33l2c+nn/EohE/4ZBXv2Y0lEQEYa TWXw== X-Gm-Message-State: AOJu0Yz3PmQoVuRpJHW3wmh0L7sG4krpt2mgulZdkiKa/8v7Ng55u5KO LECEvaIbWt2aFE9fTu6+pxUloyjMcIpdT7BqXsBRqljieAacmkLhtSobIv4t1JVo0PmV9bX26ix 15vwxWA== X-Google-Smtp-Source: AGHT+IF20x8ePnHQeOTMWmc62GgaNvFSf4hhjn7DeEGwKPf/ahMUtNfsCr2ZKZrS/sXSWylkloJfyg== X-Received: by 2002:a05:6a21:6802:b0:1c4:23f0:9665 with SMTP id adf61e73a8af0-1cf2a0b7dbfmr8712618637.29.1725891985705; Mon, 09 Sep 2024 07:26:25 -0700 (PDT) From: Hyman Huang To: qemu-devel@nongnu.org Cc: Peter Xu , Fabiano Rosas , Eric Blake , Markus Armbruster , David Hildenbrand , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , yong.huang@smartx.com Subject: [PATCH RESEND RFC 10/10] tests/migration-tests: Add test case for responsive CPU throttle Date: Mon, 9 Sep 2024 22:25:43 +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::42d; envelope-from=yong.huang@smartx.com; helo=mail-pf1-x42d.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: 1725892016058116600 Content-Type: text/plain; charset="utf-8" Despite the fact that the responsive CPU throttle is enabled, the dirty sync count may not always increase because this is an optimization that might not happen in any situation. This test case just making sure it doesn't interfere with any current functionality. Signed-off-by: Hyman Huang --- tests/qtest/migration-test.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c index 4626301435..cf0b1dcb50 100644 --- a/tests/qtest/migration-test.c +++ b/tests/qtest/migration-test.c @@ -718,6 +718,7 @@ typedef struct { typedef struct { /* CPU throttle parameters */ bool periodic; + bool responsive; } AutoConvergeArgs; =20 static int test_migrate_start(QTestState **from, QTestState **to, @@ -2795,6 +2796,7 @@ static void test_migrate_auto_converge_args(AutoConve= rgeArgs *input_args) QTestState *from, *to; int64_t percentage; bool periodic =3D (input_args && input_args->periodic); + bool responsive =3D (input_args && input_args->responsive); =20 /* * We want the test to be stable and as fast as possible. @@ -2820,6 +2822,16 @@ static void test_migrate_auto_converge_args(AutoConv= ergeArgs *input_args) periodic_throttle_interval); } =20 + if (responsive) { + /* + * The dirty-sync-count may not always go down while using respons= ive + * throttle because it is an optimization and may not take effect = in + * any scenario. Just making sure this feature doesn't break any + * existing functionality by turning it on. + */ + migrate_set_parameter_bool(from, "cpu-responsive-throttle", true); + } + /* * Set the initial parameters so that the migration could not converge * without throttling. @@ -2902,6 +2914,12 @@ static void test_migrate_auto_converge_periodic_thro= ttle(void) test_migrate_auto_converge_args(&args); } =20 +static void test_migrate_auto_converge_responsive_throttle(void) +{ + AutoConvergeArgs args =3D {.responsive =3D true}; + test_migrate_auto_converge_args(&args); +} + static void * test_migrate_precopy_tcp_multifd_start_common(QTestState *from, QTestState *to, @@ -3955,6 +3973,8 @@ int main(int argc, char **argv) test_migrate_auto_converge); migration_test_add("/migration/auto_converge_periodic_throttle", test_migrate_auto_converge_periodic_throttle); + migration_test_add("/migration/auto_converge_responsive_throttle", + test_migrate_auto_converge_responsive_throttle); if (g_str_equal(arch, "x86_64") && has_kvm && kvm_dirty_ring_supported()) { migration_test_add("/migration/dirty_limit", --=20 2.39.1