diff mbox series

[RFC,4/6] migration: Introduce dirtylimit capability

Message ID 2ef63cf661750cd848492c4f917e46e3700c1409.1652762652.git.huangy81@chinatelecom.cn (mailing list archive)
State New, archived
Headers show
Series migration: introduce dirtylimit capability | expand

Commit Message

Hyman Huang May 17, 2022, 6:35 a.m. UTC
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(-)

Comments

Eric Blake May 18, 2022, 3:20 p.m. UTC | #1
On Tue, May 17, 2022 at 02:35:04PM +0800, huangy81@chinatelecom.cn wrote:
> 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.

s/durty/during/ ?

> 
> Dirtylimit dirtylimit capability is kind of like

Doubled word

> 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>
> ---

> +++ 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)

7.1

same question about naming it 'dirty-limit'
diff mbox series

Patch

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: