From nobody Mon Feb 9 07:26:57 2026 Delivered-To: importer@patchew.org Received-SPF: none (zohomail.com: 8.43.85.245 is neither permitted nor denied by domain of lists.libvirt.org) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; spf=none (zohomail.com: 8.43.85.245 is neither permitted nor denied by domain of lists.libvirt.org) smtp.mailfrom=devel-bounces@lists.libvirt.org Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1701304010119226.37980135322653; Wed, 29 Nov 2023 16:26:50 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 996) id 7CEAA1B8A; Wed, 29 Nov 2023 19:26:49 -0500 (EST) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 8CE9E1AF3; Wed, 29 Nov 2023 19:22:09 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 996) id 985981A40; Wed, 29 Nov 2023 19:21:41 -0500 (EST) Received: from mail-pl1-f178.google.com (mail-pl1-f178.google.com [209.85.214.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id BC17D19AA for ; Wed, 29 Nov 2023 19:21:40 -0500 (EST) Received: by mail-pl1-f178.google.com with SMTP id d9443c01a7336-1cfb30ce241so4127315ad.0 for ; Wed, 29 Nov 2023 16:21:40 -0800 (PST) Received: from localhost.localdomain ([118.114.59.192]) by smtp.gmail.com with ESMTPSA id b21-20020a170902d31500b001bc930d4517sm12801758plc.42.2023.11.29.16.21.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Nov 2023 16:21:38 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.4 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701303699; x=1701908499; 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=aLu9H/I4md/6laoSE6/bHnihb2aTujuXtpgQBgT0WRo=; b=Co4TommeHRWO5qHyZtUFr5+eXl3kH8uQeCI3PIIV9rQUAbWkjLesYuU72syfJcxQDY zmoIpU09fDjzKSdP4mVM47UH9i5zuIbshxPhNIRs6DtaPsrsdVx68PbF41JNMGMHQEZb 0FiVEDMFVbvYPpszEItsaThxkORkiGjVMEqFs2KOVaqxFp46VYeR38lBXm8jlOXOTkNX Q7bzqj+OKH/s3PoB+EQDzHNzpU89uwuSBdCIwf336EIG8Gcf25J4fySE/Un21hte0cCS xVCyN51F6KCkqILGVabukwY8vzADLAhRE13o1djazQc9UxGoBtk4L4Le5KruPYz5WaL3 DsoQ== X-Gm-Message-State: AOJu0YxkgcFZ41i4bCPmNcBQzaVK/IQ0oZLtupImcePSeXMQ20s0d+Gy BdrErdBa9Y/uHQjLiS92I9SupTRdzXc/azK5Kzi64EgX X-Google-Smtp-Source: AGHT+IErbMKD4PntD7i7/wJxHK1rtwHfuVbFZ3L2Xgf1mXtQntH4O/zzClKJaoVM55p8XJaUyE+HQQ== X-Received: by 2002:a17:902:d303:b0:1cf:876e:aa41 with SMTP id b3-20020a170902d30300b001cf876eaa41mr22195650plc.30.1701303698949; Wed, 29 Nov 2023 16:21:38 -0800 (PST) From: Hyman Huang To: devel@lists.libvirt.org Subject: [PATCH 3/4] virsh: Add support for VIR_MIGRATE_DIRTY_LIMIT flag Date: Thu, 30 Nov 2023 08:21:23 +0800 Message-Id: <515e18fa598df716ceb7f8cc55657c567618189c.1701303444.git.yong.huang@smartx.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: References: MIME-Version: 1.0 Message-ID-Hash: NNN7VCMX3ZWWFB22Y25RNOXF6BG75NFX X-Message-ID-Hash: NNN7VCMX3ZWWFB22Y25RNOXF6BG75NFX X-MailFrom: yong.huang@smartx.com X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0 CC: Hyman Huang X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1701304012108000001 Introudce option to enable dirty-limit convergence algorithim during live migration. Signed-off-by: Hyman Huang --- docs/manpages/virsh.rst | 10 +++++++++- src/libvirt-domain.c | 8 ++++++++ tools/virsh-domain.c | 10 ++++++++++ 3 files changed, 27 insertions(+), 1 deletion(-) diff --git a/docs/manpages/virsh.rst b/docs/manpages/virsh.rst index 3e7a4c6c22..d1d20cb5ba 100644 --- a/docs/manpages/virsh.rst +++ b/docs/manpages/virsh.rst @@ -3376,7 +3376,7 @@ migrate [--compressed] [--comp-methods method-list] [--comp-mt-level] [--comp-mt-threads] [--comp-mt-dthreads] [--comp-xbzrle-cache] [--comp-zlib-level] [--comp-zstd-level] - [--auto-converge] [auto-converge-initial] + [--dirty-limit] [--auto-converge] [auto-converge-initial] [auto-converge-increment] [--persistent-xml file] [--tls] [--postcopy-bandwidth bandwidth] [--parallel [--parallel-connections connections]] @@ -3432,6 +3432,14 @@ source or destination host and the ``migrate`` comma= nd will report an error leaving the domain active on both hosts. To recover from such situation re= peat the original ``migrate`` command with an additional *--postcopy-resume* fl= ag. =20 +*--dirty-limit* forces convergence using dirty-limit algorithms during live +migration. For QEMU/KVM, this means migration will throttle vCPUs as neede= d to +keep their dirty page rate within the migration parameter ``vcpu-dirty-lim= it`` +(1 megabits/s by default). This can improve the responsiveness of large gu= ests +during live migration and result in more stable read performance. It requi= res +dirty-ring size configuration and conflicts with the traditional +``auto-converge`` algorithm. + *--auto-converge* forces convergence during live migration. The initial guest CPU throttling rate can be set with *auto-converge-initial*. If the initial throttling rate is not enough to ensure convergence, the rate is diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c index 77a9682ecb..dde60ab05b 100644 --- a/src/libvirt-domain.c +++ b/src/libvirt-domain.c @@ -4227,6 +4227,10 @@ virDomainMigrate3(virDomainPtr domain, /* Now checkout the destination */ virCheckReadOnlyGoto(dconn->flags, error); =20 + VIR_EXCLUSIVE_FLAGS_GOTO(VIR_MIGRATE_AUTO_CONVERGE, + VIR_MIGRATE_DIRTY_LIMIT, + error); + VIR_EXCLUSIVE_FLAGS_GOTO(VIR_MIGRATE_NON_SHARED_DISK, VIR_MIGRATE_NON_SHARED_INC, error); @@ -4652,6 +4656,10 @@ virDomainMigrateToURI3(virDomainPtr domain, virCheckDomainReturn(domain, -1); virCheckReadOnlyGoto(domain->conn->flags, error); =20 + VIR_EXCLUSIVE_FLAGS_GOTO(VIR_MIGRATE_AUTO_CONVERGE, + VIR_MIGRATE_DIRTY_LIMIT, + error); + VIR_EXCLUSIVE_FLAGS_GOTO(VIR_MIGRATE_TUNNELLED, VIR_MIGRATE_PARALLEL, error); diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index 66f933dead..3f34230e6b 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -10981,6 +10981,10 @@ static const vshCmdOptDef opts_migrate[] =3D { .type =3D VSH_OT_BOOL, .help =3D N_("compress repeated pages during live migration") }, + {.name =3D "dirty-limit", + .type =3D VSH_OT_BOOL, + .help =3D N_("force convergence with dirty-limit algorithim during li= ve migration") + }, {.name =3D "auto-converge", .type =3D VSH_OT_BOOL, .help =3D N_("force convergence during live migration") @@ -11167,6 +11171,7 @@ doMigrate(void *opaque) { "change-protection", VIR_MIGRATE_CHANGE_PROTECTION }, { "unsafe", VIR_MIGRATE_UNSAFE }, { "compressed", VIR_MIGRATE_COMPRESSED }, + { "dirty-limit", VIR_MIGRATE_DIRTY_LIMIT }, { "auto-converge", VIR_MIGRATE_AUTO_CONVERGE }, { "rdma-pin-all", VIR_MIGRATE_RDMA_PIN_ALL }, { "offline", VIR_MIGRATE_OFFLINE }, @@ -11193,6 +11198,11 @@ doMigrate(void *opaque) flags |=3D flagmap[i].migflag; } =20 + if (flags & VIR_MIGRATE_DIRTY_LIMIT && flags & VIR_MIGRATE_AUTO_CONVER= GE) { + vshError(ctl, "'--dirty-limit' conflicts with '--auto-converge'"); + goto out; + } + if (flags & VIR_MIGRATE_NON_SHARED_SYNCHRONOUS_WRITES && !(flags & (VIR_MIGRATE_NON_SHARED_DISK | VIR_MIGRATE_NON_SHARED_DI= SK))) { vshError(ctl, "'--copy-storage-synchronous-writes' requires one of= '--copy-storage-all', '--copy-storage-inc'"); --=20 2.39.1 _______________________________________________ Devel mailing list -- devel@lists.libvirt.org To unsubscribe send an email to devel-leave@lists.libvirt.org