From nobody Sun Nov 24 08:17:17 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=1725889903; cv=none; d=zohomail.com; s=zohoarc; b=juEj+avc+D8ZyGArfYgdDk8lIEzWnyUCOlPpWySaBV7pGigltWcSL1wS/cH1u4yV1URsPJ1ERQScKkpPSWxMuzftOEt+oFxRrekQSY8joValj+ancj9CW7g+CSGH567uZamxWTUvjm1s+ZEaRYkbLJbh1bzt1ZzEaBBQLdSDv6E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1725889903; 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=K7tRReAfdJphXBiGrrCzXhLL5cxV8zMWyb7527TNZ1P6oWAGTrHGJrvMaIZ4uDOwREmy0rlIcX68BHuCZ31mY9qBdMBa2QP7VJSbuM0Vs5XSziJA5NhzQBMyiiUtv4/upL0nE0uFCkx6n/UMMnde4RqucGUGBvkCBkg44/iK/G8= 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 1725889903488185.44333870691707; Mon, 9 Sep 2024 06:51:43 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1snelV-0002EL-I6; Mon, 09 Sep 2024 09:49:13 -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 1snelT-0001yF-Im for qemu-devel@nongnu.org; Mon, 09 Sep 2024 09:49:11 -0400 Received: from mail-pg1-x52d.google.com ([2607:f8b0:4864:20::52d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1snelR-0000CO-Sd for qemu-devel@nongnu.org; Mon, 09 Sep 2024 09:49:11 -0400 Received: by mail-pg1-x52d.google.com with SMTP id 41be03b00d2f7-7163489149eso3490940a12.1 for ; Mon, 09 Sep 2024 06:49:09 -0700 (PDT) Received: from localhost.localdomain ([118.114.94.226]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2dab2c6b0b9sm7841031a91.0.2024.09.09.06.49.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Sep 2024 06:49:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=smartx-com.20230601.gappssmtp.com; s=20230601; t=1725889748; x=1726494548; 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=Vk5g3uuJKmWRiPeNB1SKeckjqi9j4WFAI4DbheuCZnr67K48RZXa//dR/OUgGmU9hr odVRKKD8e+F31n4y3X2q4Rx8GM85RTT9ArpuY1DKHpR+GVt0/neTZB9pQXIuQsQuXa3K hP7qZ1C7JGdZ03A7oL8ez29VH5cHJ465EhSqHuAQnNwE2GFoaBhaPrbu121g+ML6XaRV Fdee78uraHCnAdRam4fPGypuGF/EW8M7MQVdR+/GlNxRWxszVIzo+26g6i51ZDgtS7xP hEdILDHIN4ZlVWP8yGW37/m2rG7uRdzV80UgI+iIBKXRjkK9gUogSlKpFHA6uXPpogcY xNtA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725889748; x=1726494548; 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=w9T53o3S4e6OoKhM0xN7NIeMxX440SYSqsVMgWd5V7XiLChEbowoEQIPKWdgBIR8y7 xP6gE8eqzfGpqzSiDQwxXepXjIfmRfH9cU3Zqyrx2MYgJVqVgjbmcgOsSibo2E7BEZ+W NPLXy303l0cxbxNpS7HIUf2E2pRmablKAmMm6IZTkeGvDMTeF2NeAdIP9vIFa0Eho5E8 AoLPqy+zN/TEwp100YJi3MviloNs3COY/qgxVyD1MM9d5O1pS1NJEogeVnHzaATksMaF M9jyAlhH8Ndfy6dDxZjy+FhE9NsClSB9mKXy6zLgb7ZlIrNubqSnXx9hRitbJXm7acZf BaDw== X-Gm-Message-State: AOJu0Ywu/r4g8IP+2H3+MXZ5XYdnBk1Z7CSMh097lElgFwNHEzkg/f2l iqXlF2lzMjj9Kok6q8TfIo76S3O3/s84MkkktwmZG5F0k50Yi5JHetY1rpKcLZiTy2bf6HhUjk7 WXpdw4g== X-Google-Smtp-Source: AGHT+IEIHouTQrQxgz/J2sEL4N1nMmDwA/0cnxC2g3gQYu8nJi+33wGAmO0AA91dNxDkkL4OiicYUQ== X-Received: by 2002:a05:6a20:cf8f:b0:1cf:39ee:f259 with SMTP id adf61e73a8af0-1cf39eef59emr5103855637.5.1725889747596; Mon, 09 Sep 2024 06:49:07 -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 RFC 10/10] tests/migration-tests: Add test case for responsive CPU throttle Date: Mon, 9 Sep 2024 21:47:22 +0800 Message-Id: <96eeea4efd3417212d6e2639bc118b90d4dcf926.1725889277.git.yong.huang@smartx.com> 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::52d; envelope-from=yong.huang@smartx.com; helo=mail-pg1-x52d.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: 1725889906888116600 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