From nobody Fri May 17 00:35:49 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=git.sr.ht ARC-Seal: i=1; a=rsa-sha256; t=1697078716; cv=none; d=zohomail.com; s=zohoarc; b=dDoxTD1gJ0VfkVGg/61oXP0NrUlpjuHtTvKCtZ42PWAu4G6yfw9IXiBhxoP5BnsUNcjfn3mmIbkzJj20IcGHTZloY1Er2f9iBP9tSI/q9tzNoxOyrfu9JJdQYb8LfwfSIWZO0klFV42inMsRbwIZbrcpWISpOvzIQH0y/sCX8Xg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1697078716; h=Content-Type: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:Reply-To:Reply-To:Sender:Subject:Subject:To:To:Message-Id; bh=qLsDhxkA+laFO5Qo/NXF61TPGO8WWAzKkLozUbjXFp4=; b=OUpFseDoen8NlqjsbscZTIWdQ8dId3/mmo7foOZI0ietyxjyyaUTZuvH6g/XT/R8KnC3p1Q/r+MxhQDXUCLVGAragxr6iwOo4dnpuEYwkedDUV0YcwoWJTXqxgPHUpSCcKDGjlheAyfkM7HLTilhfOnl6u9vvTXvvZeFLtPaFz0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1697078715908695.7601882817066; Wed, 11 Oct 2023 19:45:15 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-643-oh1fuUCuNV2gzEcY4wtC0g-1; Wed, 11 Oct 2023 22:45:11 -0400 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 797BA2815E43; Thu, 12 Oct 2023 02:45:09 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9DB6C492B00; Thu, 12 Oct 2023 02:45:07 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 2955719465A2; Thu, 12 Oct 2023 02:45:07 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id ACAEB1946586 for ; Thu, 12 Oct 2023 02:45:05 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 9CD4910F1BE8; Thu, 12 Oct 2023 02:45:05 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast01.extmail.prod.ext.rdu2.redhat.com [10.11.55.17]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 94CEC10F1BE7 for ; Thu, 12 Oct 2023 02:45:05 +0000 (UTC) Received: from us-smtp-inbound-delivery-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7C695858280 for ; Thu, 12 Oct 2023 02:45:05 +0000 (UTC) Received: from mail-b.sr.ht (mail-b.sr.ht [173.195.146.151]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-628-fi8FFdoEMsmM8YHy7tRJIg-1; Wed, 11 Oct 2023 22:45:03 -0400 Received: from git.sr.ht (unknown [173.195.146.142]) by mail-b.sr.ht (Postfix) with ESMTPSA id 8F9DB11F1D4; Thu, 12 Oct 2023 02:39:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1697078714; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:list-id:list-help:list-unsubscribe: list-subscribe:list-post; bh=qLsDhxkA+laFO5Qo/NXF61TPGO8WWAzKkLozUbjXFp4=; b=WUE3wO1sknachFBOZ+dt3CyV/7eHQ95XRcsUyWjpqTcNoBEacgIF5rHiVZd3cGLpQHxbor Ae0SKPfnhoCf3/2OEEpr7FEZuYcPfRq4gEBCVRPrp3GlSZoa+6FlThvbawDSiy6L0ovve+ 6fbnXpnZTeg53noKc3I3dQCBF2obbGo= X-MC-Unique: oh1fuUCuNV2gzEcY4wtC0g-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: fi8FFdoEMsmM8YHy7tRJIg-1 From: ~hyman Date: Wed, 11 Oct 2023 10:09:39 +0800 Subject: [PATCH Libvirt 1/4] Add VIR_MIGRATE_DIRTY_LIMIT flag Message-ID: <169707837820.18882.17395313264013602078-1@git.sr.ht> In-Reply-To: <169707837820.18882.17395313264013602078-0@git.sr.ht> To: libvir-list@redhat.com MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: ~hyman Cc: yong.huang@smartx.com Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: git.sr.ht Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1697078717885100003 From: Hyman Huang The flag can be used to enable dirty-limit capability for live migration. Signed-off-by: Hyman Huang --- include/libvirt/libvirt-domain.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/libvirt/libvirt-domain.h b/include/libvirt/libvirt-dom= ain.h index a1902546bb..4a4209c01a 100644 --- a/include/libvirt/libvirt-domain.h +++ b/include/libvirt/libvirt-domain.h @@ -1100,6 +1100,11 @@ typedef enum { * Since: 8.5.0 */ VIR_MIGRATE_ZEROCOPY =3D (1 << 20), + + /* Enable dirty-limit capability to make migration convergent. + * Since: 9.9.0 + */ + VIR_MIGRATE_DIRTY_LIMIT =3D (1 << 21), } virDomainMigrateFlags; =20 =20 --=20 2.38.5 From nobody Fri May 17 00:35:49 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=git.sr.ht ARC-Seal: i=1; a=rsa-sha256; t=1697078715; cv=none; d=zohomail.com; s=zohoarc; b=LKrB9AmOJO5uuMpcGzheSVQDPZEczXiDhK1bf1mK/C2KsDOeowI8yuqytMVMslyuFrqLj82pXqwuCUZjQjF7CuGF80YL2SRSKNG730J5ahvbXgDWR3Z3vZRrn8nVlqXH3aFa4mg7Qr4QCrbtZhMTEx10EzrUOqMoTS0UKMul+Wg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1697078715; h=Content-Type: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:Reply-To:Reply-To:Sender:Subject:Subject:To:To:Message-Id; bh=klMJGluz/LxfkX7lkiYleZW5OZMg8iC3nlc/Ws34cEw=; b=gG1wolz1sB4QUiesuxx/2TL2rGwcKQW5FA2qaqaDsCefp6I63gLSwG4Nx8qOHblYsCzibxBapyLIb7dpTsgpxrt15lbBgiebMwDWT6d4FtOXeGRWHAeSea0L6jMR78EsAoU1yk9VR4zALqE4jhBG0v2zgShZ+HGUNF9QsfhZmZ0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1697078715738722.9796041472829; Wed, 11 Oct 2023 19:45:15 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-599-Czs5-YAsO-CaowBsjF4iug-1; Wed, 11 Oct 2023 22:45:13 -0400 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5D95E101B045; Thu, 12 Oct 2023 02:45:10 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 477A9492B07; Thu, 12 Oct 2023 02:45:10 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id A1DCA1946597; Thu, 12 Oct 2023 02:45:08 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 00FB11946594 for ; Thu, 12 Oct 2023 02:45:08 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id D4BEC1005B8E; Thu, 12 Oct 2023 02:45:07 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast06.extmail.prod.ext.rdu2.redhat.com [10.11.55.22]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CD2E2111CD24 for ; Thu, 12 Oct 2023 02:45:07 +0000 (UTC) Received: from us-smtp-inbound-delivery-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id AFFC8185A795 for ; Thu, 12 Oct 2023 02:45:07 +0000 (UTC) Received: from mail-b.sr.ht (mail-b.sr.ht [173.195.146.151]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-627--YvBs3cIP1CrBri6QvQtkg-1; Wed, 11 Oct 2023 22:45:03 -0400 Received: from git.sr.ht (unknown [173.195.146.142]) by mail-b.sr.ht (Postfix) with ESMTPSA id BA38111F1F6; Thu, 12 Oct 2023 02:39:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1697078714; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:list-id:list-help:list-unsubscribe: list-subscribe:list-post; bh=klMJGluz/LxfkX7lkiYleZW5OZMg8iC3nlc/Ws34cEw=; b=UZ0/L7PbjRSeGeyIyZvXniVi44kdtOCkd5LovuctnqL5yU8M8WF+0DA3wS18UX/6mqbABL MoTDrK+E65D2/4i6KUttp3r9mjgEzSLxBobaYBWIgAEcI1IHK+/egWMFTWRt+2vTcbz/R5 dj6ZJeTrfz/M5KjqJ2yIs1Ibz53LmNk= X-MC-Unique: Czs5-YAsO-CaowBsjF4iug-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: -YvBs3cIP1CrBri6QvQtkg-1 From: ~hyman Date: Wed, 11 Oct 2023 10:26:52 +0800 Subject: [PATCH Libvirt 2/4] qemu_migration: Implement VIR_MIGRATE_DIRTY_LIMIT flag Message-ID: <169707837820.18882.17395313264013602078-2@git.sr.ht> In-Reply-To: <169707837820.18882.17395313264013602078-0@git.sr.ht> To: libvir-list@redhat.com MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: ~hyman Cc: yong.huang@smartx.com Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: git.sr.ht Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1697078717886100004 From: Hyman Huang Signed-off-by: Hyman Huang --- src/qemu/qemu_migration.c | 8 ++++++++ src/qemu/qemu_migration.h | 1 + src/qemu/qemu_migration_params.c | 6 ++++++ src/qemu/qemu_migration_params.h | 1 + 4 files changed, 16 insertions(+) diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index 011482c2b5..15cd80df9f 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -2560,6 +2560,14 @@ qemuMigrationSrcBeginPhase(virQEMUDriver *driver, if (!qemuMigrationSrcIsAllowed(vm, true, vm->job->asyncJob, flags)) return NULL; =20 + if (flags & VIR_MIGRATE_DIRTY_LIMIT && + (!(vm->def->features[VIR_DOMAIN_FEATURE_KVM] =3D=3D VIR_TRISTATE_S= WITCH_ON && + vm->def->kvm_features->features[VIR_DOMAIN_KVM_DIRTY_RING] =3D= =3D VIR_TRISTATE_SWITCH_ON))) { + virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s", + _("dirtylimit migration requires dirty-ring feature= s enabled")); + return NULL; + } + if (!(flags & (VIR_MIGRATE_UNSAFE | VIR_MIGRATE_OFFLINE)) && !qemuMigrationSrcIsSafe(vm->def, priv->qemuCaps, nmigrate_disks, migrate_disks, flags)) diff --git a/src/qemu/qemu_migration.h b/src/qemu/qemu_migration.h index ed62fd4a91..a2a598fe28 100644 --- a/src/qemu/qemu_migration.h +++ b/src/qemu/qemu_migration.h @@ -62,6 +62,7 @@ VIR_MIGRATE_NON_SHARED_SYNCHRONOUS_WRITES | \ VIR_MIGRATE_POSTCOPY_RESUME | \ VIR_MIGRATE_ZEROCOPY | \ + VIR_MIGRATE_DIRTY_LIMIT | \ 0) =20 /* All supported migration parameters and their types. */ diff --git a/src/qemu/qemu_migration_params.c b/src/qemu/qemu_migration_par= ams.c index 79fe6e97c8..797293d8e7 100644 --- a/src/qemu/qemu_migration_params.c +++ b/src/qemu/qemu_migration_params.c @@ -99,6 +99,7 @@ VIR_ENUM_IMPL(qemuMigrationCapability, "dirty-bitmaps", "return-path", "zero-copy-send", + "dirty-limit", ); =20 =20 @@ -194,6 +195,11 @@ static const qemuMigrationParamsFlagMapItem qemuMigrat= ionParamsFlagMap[] =3D { VIR_MIGRATE_ZEROCOPY, QEMU_MIGRATION_CAP_ZERO_COPY_SEND, QEMU_MIGRATION_SOURCE}, + + {QEMU_MIGRATION_FLAG_REQUIRED, + VIR_MIGRATE_DIRTY_LIMIT, + QEMU_MIGRATION_CAP_DIRTY_LIMIT, + QEMU_MIGRATION_SOURCE}, }; =20 /* Translation from VIR_MIGRATE_PARAM_* typed parameters to diff --git a/src/qemu/qemu_migration_params.h b/src/qemu/qemu_migration_par= ams.h index 5857673227..44a44aae07 100644 --- a/src/qemu/qemu_migration_params.h +++ b/src/qemu/qemu_migration_params.h @@ -40,6 +40,7 @@ typedef enum { QEMU_MIGRATION_CAP_BLOCK_DIRTY_BITMAPS, QEMU_MIGRATION_CAP_RETURN_PATH, QEMU_MIGRATION_CAP_ZERO_COPY_SEND, + QEMU_MIGRATION_CAP_DIRTY_LIMIT, =20 QEMU_MIGRATION_CAP_LAST } qemuMigrationCapability; --=20 2.38.5 From nobody Fri May 17 00:35:49 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=git.sr.ht ARC-Seal: i=1; a=rsa-sha256; t=1697078718; cv=none; d=zohomail.com; s=zohoarc; b=E7AOfIjMEaLQUoWHRR5miNHKbg23Dbez4T7T5XhiKuB8JgCSmiAzpOSsR6SoWIk2Vl6N3oliM60fUqYN5dwwz6b5dXocV8bXPkAE31ut0YySVDuzN6cUockaiYZGedSdEel7EfBMKCNw6+HBzKL4lMB95StoIWPb9UZ2dJEIE7E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1697078718; h=Content-Type: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:Reply-To:Reply-To:Sender:Subject:Subject:To:To:Message-Id; bh=7jGEKQJIKPTXT9EmZzX1t6sQce4R9080CsHkecdLzWU=; b=CHgYpc2qWFe2frjKA9/ZtFQkpJkgkRtgdGl/Fkzq2JclaZ387IKrlDQjVlD0pVHf3lYFjY9WW0jINyL69QfoZ0KT02lOXfu3eIIH2BGC58xqZtACd+nVJLS5sN6WDYu4CQh9+0MTpRK0nUYy/YkV5K+jALd+oGFMDzI1/4giSPc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 169707871851976.04709838283168; Wed, 11 Oct 2023 19:45:18 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-569-uzvKuO_eO5urAZBS7T4Fhw-1; Wed, 11 Oct 2023 22:45:12 -0400 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8A16B2815E46; Thu, 12 Oct 2023 02:45:09 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 73C68492B03; Thu, 12 Oct 2023 02:45:09 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 69B3919466F5; Thu, 12 Oct 2023 02:45:07 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id CCA451946586 for ; Thu, 12 Oct 2023 02:45:05 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id AF410492B04; Thu, 12 Oct 2023 02:45:05 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast06.extmail.prod.ext.rdu2.redhat.com [10.11.55.22]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A5F07492B06 for ; Thu, 12 Oct 2023 02:45:05 +0000 (UTC) Received: from us-smtp-inbound-delivery-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8707E185A7B3 for ; Thu, 12 Oct 2023 02:45:05 +0000 (UTC) Received: from mail-b.sr.ht (mail-b.sr.ht [173.195.146.151]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-641-UmZp5Z2zOl2gBIb43ZG9FQ-1; Wed, 11 Oct 2023 22:45:02 -0400 Received: from git.sr.ht (unknown [173.195.146.142]) by mail-b.sr.ht (Postfix) with ESMTPSA id E2D5511F1F7; Thu, 12 Oct 2023 02:39:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1697078717; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:list-id:list-help:list-unsubscribe: list-subscribe:list-post; bh=7jGEKQJIKPTXT9EmZzX1t6sQce4R9080CsHkecdLzWU=; b=aGci/ICTuaWqV3biBIwPbcz9NHw97Rv1sZsb6QFtGLUK6FZ0LZc8/dahFtHXaSsBdwAEnO gRbEq8vQbhP7SLyuEG8B5/Ry89klusAaNC8nDx7QG5JFl2xNKy8L6Em+SeIOczPa7sHun0 xVulFhqNwQd9iYVLt4LfYU9cCBS28zc= X-MC-Unique: uzvKuO_eO5urAZBS7T4Fhw-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: UmZp5Z2zOl2gBIb43ZG9FQ-1 From: ~hyman Date: Thu, 12 Oct 2023 09:15:30 +0800 Subject: [PATCH Libvirt 3/4] virsh: Add support for VIR_MIGRATE_DIRTY_LIMIT flag Message-ID: <169707837820.18882.17395313264013602078-3@git.sr.ht> In-Reply-To: <169707837820.18882.17395313264013602078-0@git.sr.ht> To: libvir-list@redhat.com MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: ~hyman Cc: yong.huang@smartx.com Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: git.sr.ht Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1697078719572100007 From: Hyman Huang 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 c425974912..9342dd4cfd 100644 --- a/docs/manpages/virsh.rst +++ b/docs/manpages/virsh.rst @@ -3373,7 +3373,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]] @@ -3429,6 +3429,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 6616294fc1..f1a7681da5 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); @@ -4637,6 +4641,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 7abafe2ba3..31ee31b394 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -10922,6 +10922,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") @@ -11108,6 +11112,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 }, @@ -11134,6 +11139,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.38.5 From nobody Fri May 17 00:35:49 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=git.sr.ht ARC-Seal: i=1; a=rsa-sha256; t=1697078717; cv=none; d=zohomail.com; s=zohoarc; b=hcIoDP7zjVkpcKMZxiWWlJa0XSe2+0W9HDTsN5lOPLt93vlmDTXHk7lVuLLUZD5zX4I5g6FWXe7BixfbaVhW8CO4RxN4TmMrT25Woowz4zjZ7bJMHTgNd9sNtnNlSECWPrwUfL0RDvZuNMQeiwwigU57DIxyukQZpqx2ZSn7vsQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1697078717; h=Content-Type: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:Reply-To:Reply-To:Sender:Subject:Subject:To:To:Message-Id; bh=rLQ4hBhYlTMI6kXD8XX9zIwTyWqsen0BYaxRAw2BkWg=; b=ezAxJo/u9JXBKhwE9hECQGhTzqDQDDq9H13xNgxVQom0hFBeWG8YQLpnLn1uJLLHz1kr8OO24+sQ2QzlMskbpw6zO2GocFk1quSazjEspT8zRTGdOJYWpuaJ/moovI/pRYQQCA+MRx1MbIS8oRU/orbklSNvSwwYUvDSVp78kRI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1697078717300694.6831284632264; Wed, 11 Oct 2023 19:45:17 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-534-9xMiLmXBPn-WyBlojzs2kA-1; Wed, 11 Oct 2023 22:45:12 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 77AF82815E32; Thu, 12 Oct 2023 02:45:09 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9DDB6215671F; Thu, 12 Oct 2023 02:45:07 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 2AF0319465A4; Thu, 12 Oct 2023 02:45:07 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 744BE1946586 for ; Thu, 12 Oct 2023 02:45:05 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 61147492C3E; Thu, 12 Oct 2023 02:45:05 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast07.extmail.prod.ext.rdu2.redhat.com [10.11.55.23]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5A7AE492B01 for ; Thu, 12 Oct 2023 02:45:05 +0000 (UTC) Received: from us-smtp-inbound-delivery-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 3E4B33C0F679 for ; Thu, 12 Oct 2023 02:45:05 +0000 (UTC) Received: from mail-b.sr.ht (mail-b.sr.ht [173.195.146.151]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-629-IUQy1gbbMA-BGYf1qsYfNw-1; Wed, 11 Oct 2023 22:45:03 -0400 Received: from git.sr.ht (unknown [173.195.146.142]) by mail-b.sr.ht (Postfix) with ESMTPSA id 2FDF711F1F8; Thu, 12 Oct 2023 02:39:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1697078716; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:list-id:list-help:list-unsubscribe: list-subscribe:list-post; bh=rLQ4hBhYlTMI6kXD8XX9zIwTyWqsen0BYaxRAw2BkWg=; b=gY6LCUIdbxfOR7LbMcI3PBPyRunUqRRZ+oe0Y4cWtuTYnxsFdsmrYjxbgz3TxIZ/V1jASx 8ZzfyMipyUs+360+kAz+tdQ5wYC5fCEAO8Qt1r5QeCXStrRAT4j9tYChhsljjjIYlwH3AC DJlNWDY2J/5YNQxajnVMvCpSfKxR1+E= X-MC-Unique: 9xMiLmXBPn-WyBlojzs2kA-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: IUQy1gbbMA-BGYf1qsYfNw-1 From: ~hyman Date: Thu, 12 Oct 2023 10:13:21 +0800 Subject: [PATCH Libvirt 4/4] NEWS: document support for dirty-limit live migration Message-ID: <169707837820.18882.17395313264013602078-4@git.sr.ht> In-Reply-To: <169707837820.18882.17395313264013602078-0@git.sr.ht> To: libvir-list@redhat.com MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: ~hyman Cc: yong.huang@smartx.com Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: git.sr.ht Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1697078717783100001 From: Hyman Huang Signed-off-by: Hyman Huang --- NEWS.rst | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/NEWS.rst b/NEWS.rst index fbdd9674a3..dd0dda923e 100644 --- a/NEWS.rst +++ b/NEWS.rst @@ -25,6 +25,14 @@ v9.9.0 (unreleased) guest features to see if the current libvirt supports both deleting and reverting external snapshots. =20 + * QEMU: Support dirty-limit live migration + + Introduce ``VIR_MIGRATE_DIRTY_LIMIT`` flag for live migration API, + which can enable the dirty-limit convergence algorithm during live + migration and reap more stable read performance for guest vCPUs. + + Also, add the corresponding ``--dirty-limit`` option to ``virsh migrat= e``. + * **Improvements** =20 * **Bug fixes** --=20 2.38.5