From nobody Mon Feb 9 12:11:18 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 1699758739633787.9318368470518; Sat, 11 Nov 2023 19:12:19 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 996) id 879701A58; Sat, 11 Nov 2023 22:12:18 -0500 (EST) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 09EAE1B04; Sat, 11 Nov 2023 22:06:22 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 996) id 7F8AF1AB8; Sat, 11 Nov 2023 22:05:57 -0500 (EST) Received: from mail-pg1-f170.google.com (mail-pg1-f170.google.com [209.85.215.170]) (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 0BF5C1A95 for ; Sat, 11 Nov 2023 22:05:30 -0500 (EST) Received: by mail-pg1-f170.google.com with SMTP id 41be03b00d2f7-53fbf2c42bfso2521009a12.3 for ; Sat, 11 Nov 2023 19:05:29 -0800 (PST) Received: from localhost.localdomain ([125.69.8.82]) by smtp.gmail.com with ESMTPSA id w12-20020a17090a4f4c00b0026801e06ac1sm1830938pjl.30.2023.11.11.19.05.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 11 Nov 2023 19:05:27 -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=1699758328; x=1700363128; 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=OckIC1bdp2gRunsCQ/jobz4gA8WRykTTws7Yy7rzE1Y=; b=MWA4Z6vrRiFLRBCnvI6Sz3AouAQLR/+i5CGVT9z44cBghLAwQDyJGbUHdBcbs2Zq+z ziyPNSjWjX+fEeK/TgiBv0Iiv85IOwfffOk4B3Jcz3+2AU1reVuqjViXpqD9Jfl2zU1+ DXPdNzjWoYy3uzkoAI8Yic9MyVh5wg70DO1vFpte26WnxESVn0+nIHGM+enE6hyx9wBA fdxZXFXozaxLSmITn79L3+HZvn+oPmf8C3QEI15mwnp4X4xcOgM+AdO5TtpZbW9TdNYe HLD9G7pxuN3xTTeed5F0dlfgdAvaeFMGGcWI5RqJPCP0zWsc/glew+YoMPeyV4Eykwmj uWwA== X-Gm-Message-State: AOJu0YwVAZeZB4Qc/n/CowUD2rCyG5OBXfglSOow0C4HN1WuQDIFMh3z Tv5gBApQS6M/sr34s5/twvzYG41HELiu5R3eM3U= X-Google-Smtp-Source: AGHT+IGzu7a1agPMtlJAhNYdorT7pBHEsAEFX29vB0VupQVgAnGWjwzcpdgjgKIEMunTTK9W6dvmqw== X-Received: by 2002:a05:6a21:a59f:b0:186:2257:6228 with SMTP id gd31-20020a056a21a59f00b0018622576228mr3377337pzc.19.1699758328185; Sat, 11 Nov 2023 19:05:28 -0800 (PST) From: Hyman Huang To: devel@lists.libvirt.org Subject: [v2 3/4] virsh: Add support for VIR_MIGRATE_DIRTY_LIMIT flag Date: Sun, 12 Nov 2023 11:05:11 +0800 Message-Id: <1bc5486f46c946bf5027053a2578026e4b0a8f97.1699756433.git.yong.huang@smartx.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: References: MIME-Version: 1.0 Message-ID-Hash: IMR5NLNPXXQP3AKQCQP4PIV7QBCEQZ5Q X-Message-ID-Hash: IMR5NLNPXXQP3AKQCQP4PIV7QBCEQZ5Q 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: 1699758740420100001 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 58e1e5ea8d..e5b9679644 100644 --- a/src/libvirt-domain.c +++ b/src/libvirt-domain.c @@ -4213,6 +4213,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); @@ -4633,6 +4637,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