All of lore.kernel.org
 help / color / mirror / Atom feed
From: huangy81@chinatelecom.cn
To: qemu-devel <qemu-devel@nongnu.org>
Cc: "Dr. David Alan Gilbert" <dgilbert@redhat.com>,
	Juan Quintela <quintela@redhat.com>,
	Eric Blake <eblake@redhat.com>,
	Markus Armbruster <armbru@redhat.com>,
	Thomas Huth <thuth@redhat.com>,
	Laurent Vivier <lvivier@redhat.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Hyman Huang <huangy81@chinatelecom.cn>
Subject: [RFC 4/6] migration: Introduce dirtylimit capability
Date: Tue, 17 May 2022 14:35:04 +0800	[thread overview]
Message-ID: <2ef63cf661750cd848492c4f917e46e3700c1409.1652762652.git.huangy81@chinatelecom.cn> (raw)
In-Reply-To: <cover.1652762652.git.huangy81@chinatelecom.cn>
In-Reply-To: <cover.1652762652.git.huangy81@chinatelecom.cn>

From: Hyman Huang(黄勇) <huangy81@chinatelecom.cn>

Introduce migration dirtylimit capability, which can
be turned on before live migration and limit dirty
page rate durty live migration.

Dirtylimit dirtylimit capability is kind of like
auto-converge but using dirtylimit instead of traditional
cpu-throttle to throttle guest down.

To enable this feature, turn on the dirtylimit capability
before live migration using migratioin-set-capabilities,
and set dirtylimit-related parameters "vcpu-dirtylimit",
"vcpu-dirtylimit-period" suitably to speed up convergence.

Signed-off-by: Hyman Huang(黄勇) <huangy81@chinatelecom.cn>
---
 migration/migration.c | 7 ++++++-
 qapi/migration.json   | 5 ++++-
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/migration/migration.c b/migration/migration.c
index 9e4ce01..4a659b6 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -2427,7 +2427,11 @@ bool migrate_auto_converge(void)
 
 bool migrate_dirtylimit(void)
 {
-    return false;
+    MigrationState *s;
+
+    s = migrate_get_current();
+
+    return s->enabled_capabilities[MIGRATION_CAPABILITY_DIRTYLIMIT];
 }
 
 bool migrate_zero_blocks(void)
@@ -4270,6 +4274,7 @@ static Property migration_properties[] = {
     DEFINE_PROP_MIG_CAP("x-multifd", MIGRATION_CAPABILITY_MULTIFD),
     DEFINE_PROP_MIG_CAP("x-background-snapshot",
             MIGRATION_CAPABILITY_BACKGROUND_SNAPSHOT),
+    DEFINE_PROP_MIG_CAP("x-dirtylimit", MIGRATION_CAPABILITY_DIRTYLIMIT),
 
     DEFINE_PROP_END_OF_LIST(),
 };
diff --git a/qapi/migration.json b/qapi/migration.json
index 68c1fe0..30ad413 100644
--- a/qapi/migration.json
+++ b/qapi/migration.json
@@ -463,6 +463,9 @@
 #                       procedure starts. The VM RAM is saved with running VM.
 #                       (since 6.0)
 #
+# @dirtylimit: Use dirtylimit to throttle down guest if enabled.
+#              (since 7.0)
+#
 # Features:
 # @unstable: Members @x-colo and @x-ignore-shared are experimental.
 #
@@ -476,7 +479,7 @@
            'block', 'return-path', 'pause-before-switchover', 'multifd',
            'dirty-bitmaps', 'postcopy-blocktime', 'late-block-activate',
            { 'name': 'x-ignore-shared', 'features': [ 'unstable' ] },
-           'validate-uuid', 'background-snapshot'] }
+           'validate-uuid', 'background-snapshot', 'dirtylimit'] }
 
 ##
 # @MigrationCapabilityStatus:
-- 
1.8.3.1



  parent reply	other threads:[~2022-05-17  6:42 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-17  6:35 [RFC 0/6] migration: introduce dirtylimit capability huangy81
2022-05-17  6:35 ` [RFC 1/6] qapi/migration: Introduce vcpu-dirtylimit-period parameters huangy81
2022-05-18 15:05   ` Eric Blake
2022-05-19  3:05     ` Hyman Huang
2022-05-17  6:35 ` [RFC 2/6] qapi/migration: Introduce vcpu-dirtylimit parameters huangy81
2022-05-18 15:06   ` Eric Blake
2022-05-17  6:35 ` [RFC 3/6] migration: Implement dirtylimit convergence algo huangy81
2022-05-17  6:35 ` huangy81 [this message]
2022-05-18 15:20   ` [RFC 4/6] migration: Introduce dirtylimit capability Eric Blake
2022-05-17  6:35 ` [RFC 5/6] migration: Add dirtylimit data into migration info huangy81
2022-05-17  6:35 ` [RFC 6/6] tests: Add migration dirtylimit capability test huangy81

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2ef63cf661750cd848492c4f917e46e3700c1409.1652762652.git.huangy81@chinatelecom.cn \
    --to=huangy81@chinatelecom.cn \
    --cc=armbru@redhat.com \
    --cc=dgilbert@redhat.com \
    --cc=eblake@redhat.com \
    --cc=lvivier@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    --cc=thuth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.