- s390x/sclp: Simplify get_sclp_device() - target/ppc: Remove msr_pr macro - docs/system/target-arm: Re-alphabetize board list - migration: Extend query-migrate to provide dirty page limit info - migration: Implement dirty-limit convergence algo - migration: Put the detection logic before auto-converge checking - migration: Refactor auto-converge capability logic - migration: Introduce dirty-limit capability - qapi/migration: Introduce vcpu-dirty-limit parameters - qapi/migration: Introduce x-vcpu-dirty-limit-period parameter - Change the value of no_ged from true to false - Allow UNIX socket option for VNC websocket - tpm_emulator: Avoid double initialization during - chardev/char-socket: Update AF_UNIX for Windows - KVM: dirty ring: add missing memory barrier - i386: reset KVM nested state upon CPU reset - esp: Handle CMD_BUSRESET by resetting the SCSI bus - dbus-vmstate: Restrict error checks to registered proxies in dbus_get_proxies - vfio/pci: Add Ascend310b scend910b support - target/i386: Export RFDS bit to guests - target/i386: Add new CPU model SierraForest - target/i386: Introduce Icelake-Server-v7 to enable TSX - hw/virtio: handle un-configured shutdown in virtio-pci - target/s390x: display deprecation status in '-cpu help' - target/i386: display deprecation status in '-cpu help' - pc-bios/s390-ccw: Fix booting with logical block size < physical block size Signed-off-by: Jiabo Feng <fengjiabo1@huawei.com>
201 lines
7.7 KiB
Diff
201 lines
7.7 KiB
Diff
From 52201bf437125bb73deb8945491f7f823bdeb64a Mon Sep 17 00:00:00 2001
|
|
From: =?UTF-8?q?Hyman=20Huang=28=E9=BB=84=E5=8B=87=29?=
|
|
<yong.huang@smartx.com>
|
|
Date: Wed, 7 Jun 2023 22:58:32 +0800
|
|
Subject: [PATCH] qapi/migration: Introduce vcpu-dirty-limit parameters
|
|
MIME-Version: 1.0
|
|
Content-Type: text/plain; charset=UTF-8
|
|
Content-Transfer-Encoding: 8bit
|
|
|
|
There is a conflict when merging patches in qemu-6.2.0, and there is a phenomenon that the corresponding files and functions cannot be found.Merge after modifying the patch by wangguochun@kylinos.cn
|
|
|
|
Introduce "vcpu-dirty-limit" migration parameter used
|
|
to limit dirty page rate during live migration.
|
|
|
|
"vcpu-dirty-limit" and "x-vcpu-dirty-limit-period" are
|
|
two dirty-limit-related migration parameters, which can
|
|
be set before and during live migration by qmp
|
|
migrate-set-parameters.
|
|
|
|
This two parameters are used to help implement the dirty
|
|
page rate limit algo of migration.
|
|
|
|
Signed-off-by: Hyman Huang(黄勇) <yong.huang@smartx.com>
|
|
Acked-by: Peter Xu <peterx@redhat.com>
|
|
Reviewed-by: Juan Quintela <quintela@redhat.com>
|
|
Message-Id: <168618975839.6361.17407633874747688653-3@git.sr.ht>
|
|
Signed-off-by: Juan Quintela <quintela@redhat.com>
|
|
---
|
|
migration/migration.c | 21 +++++++++++++++++++++
|
|
monitor/hmp-cmds.c | 8 ++++++++
|
|
qapi/migration.json | 18 +++++++++++++++---
|
|
3 files changed, 44 insertions(+), 3 deletions(-)
|
|
|
|
diff --git a/migration/migration.c b/migration/migration.c
|
|
index 9672266e16..06d9b6a15d 100644
|
|
--- a/migration/migration.c
|
|
+++ b/migration/migration.c
|
|
@@ -117,6 +117,7 @@
|
|
#define DEFAULT_MIGRATE_ANNOUNCE_STEP 100
|
|
|
|
#define DEFAULT_MIGRATE_VCPU_DIRTY_LIMIT_PERIOD 1000 /* milliseconds */
|
|
+#define DEFAULT_MIGRATE_VCPU_DIRTY_LIMIT 1 /* MB/s */
|
|
|
|
static NotifierList migration_state_notifiers =
|
|
NOTIFIER_LIST_INITIALIZER(migration_state_notifiers);
|
|
@@ -920,6 +921,8 @@ MigrationParameters *qmp_query_migrate_parameters(Error **errp)
|
|
|
|
params->has_x_vcpu_dirty_limit_period = true;
|
|
params->x_vcpu_dirty_limit_period = s->parameters.x_vcpu_dirty_limit_period;
|
|
+ params->has_vcpu_dirty_limit = true;
|
|
+ params->vcpu_dirty_limit = s->parameters.vcpu_dirty_limit;
|
|
|
|
return params;
|
|
}
|
|
@@ -1513,6 +1516,14 @@ static bool migrate_params_check(MigrationParameters *params, Error **errp)
|
|
return false;
|
|
}
|
|
|
|
+ if (params->has_vcpu_dirty_limit &&
|
|
+ (params->vcpu_dirty_limit < 1)) {
|
|
+ error_setg(errp, QERR_INVALID_PARAMETER_VALUE,
|
|
+ "vcpu_dirty_limit",
|
|
+ "is invalid, it must greater then 1 MB/s");
|
|
+ return false;
|
|
+ }
|
|
+
|
|
return true;
|
|
}
|
|
|
|
@@ -1621,6 +1632,9 @@ static void migrate_params_test_apply(MigrateSetParameters *params,
|
|
dest->x_vcpu_dirty_limit_period =
|
|
params->x_vcpu_dirty_limit_period;
|
|
}
|
|
+ if (params->has_vcpu_dirty_limit) {
|
|
+ dest->vcpu_dirty_limit = params->vcpu_dirty_limit;
|
|
+ }
|
|
}
|
|
|
|
static void migrate_params_apply(MigrateSetParameters *params, Error **errp)
|
|
@@ -1752,6 +1766,9 @@ static void migrate_params_apply(MigrateSetParameters *params, Error **errp)
|
|
s->parameters.x_vcpu_dirty_limit_period =
|
|
params->x_vcpu_dirty_limit_period;
|
|
}
|
|
+ if (params->has_vcpu_dirty_limit) {
|
|
+ s->parameters.vcpu_dirty_limit = params->vcpu_dirty_limit;
|
|
+ }
|
|
}
|
|
|
|
void qmp_migrate_set_parameters(MigrateSetParameters *params, Error **errp)
|
|
@@ -4296,6 +4313,9 @@ static Property migration_properties[] = {
|
|
DEFINE_PROP_UINT64("x-vcpu-dirty-limit-period", MigrationState,
|
|
parameters.x_vcpu_dirty_limit_period,
|
|
DEFAULT_MIGRATE_VCPU_DIRTY_LIMIT_PERIOD),
|
|
+ DEFINE_PROP_UINT64("vcpu-dirty-limit", MigrationState,
|
|
+ parameters.vcpu_dirty_limit,
|
|
+ DEFAULT_MIGRATE_VCPU_DIRTY_LIMIT),
|
|
|
|
/* Migration capabilities */
|
|
DEFINE_PROP_MIG_CAP("x-xbzrle", MIGRATION_CAPABILITY_XBZRLE),
|
|
@@ -4372,6 +4392,7 @@ void migrate_params_init(MigrationParameters *params)
|
|
params->has_announce_rounds = true;
|
|
params->has_announce_step = true;
|
|
params->has_x_vcpu_dirty_limit_period = true;
|
|
+ params->has_vcpu_dirty_limit = true;
|
|
}
|
|
|
|
|
|
diff --git a/monitor/hmp-cmds.c b/monitor/hmp-cmds.c
|
|
index 680696ddd5..01493cd2c0 100644
|
|
--- a/monitor/hmp-cmds.c
|
|
+++ b/monitor/hmp-cmds.c
|
|
@@ -520,6 +520,10 @@ void hmp_info_migrate_parameters(Monitor *mon, const QDict *qdict)
|
|
monitor_printf(mon, "%s: %" PRIu64 " ms\n",
|
|
MigrationParameter_str(MIGRATION_PARAMETER_X_VCPU_DIRTY_LIMIT_PERIOD),
|
|
params->x_vcpu_dirty_limit_period);
|
|
+
|
|
+ monitor_printf(mon, "%s: %" PRIu64 " MB/s\n",
|
|
+ MigrationParameter_str(MIGRATION_PARAMETER_VCPU_DIRTY_LIMIT),
|
|
+ params->vcpu_dirty_limit);
|
|
}
|
|
|
|
qapi_free_MigrationParameters(params);
|
|
@@ -1353,6 +1357,10 @@ void hmp_migrate_set_parameter(Monitor *mon, const QDict *qdict)
|
|
p->has_x_vcpu_dirty_limit_period = true;
|
|
visit_type_size(v, param, &p->x_vcpu_dirty_limit_period, &err);
|
|
break;
|
|
+ case MIGRATION_PARAMETER_VCPU_DIRTY_LIMIT:
|
|
+ p->has_vcpu_dirty_limit = true;
|
|
+ visit_type_size(v, param, &p->vcpu_dirty_limit, &err);
|
|
+ break;
|
|
default:
|
|
assert(0);
|
|
}
|
|
diff --git a/qapi/migration.json b/qapi/migration.json
|
|
index b7dc85f7c1..f35f0377dc 100644
|
|
--- a/qapi/migration.json
|
|
+++ b/qapi/migration.json
|
|
@@ -770,6 +770,9 @@
|
|
# live migration. Should be in the range 1 to 1000ms,
|
|
# defaults to 1000ms. (Since 8.1)
|
|
#
|
|
+# @vcpu-dirty-limit: Dirtyrate limit (MB/s) during live migration.
|
|
+# Defaults to 1. (Since 8.1)
|
|
+#
|
|
# Features:
|
|
# @unstable: Members @x-checkpoint-delay and @x-vcpu-dirty-limit-period
|
|
# are experimental.
|
|
@@ -791,7 +794,8 @@
|
|
'max-cpu-throttle', 'multifd-compression',
|
|
'multifd-zlib-level', 'multifd-zstd-level',
|
|
'block-bitmap-mapping',
|
|
- { 'name': 'x-vcpu-dirty-limit-period', 'features': ['unstable'] } ] }
|
|
+ { 'name': 'x-vcpu-dirty-limit-period', 'features': ['unstable'] },
|
|
+ 'vcpu-dirty-limit'] }
|
|
|
|
##
|
|
# @MigrateSetParameters:
|
|
@@ -943,6 +947,9 @@
|
|
# live migration. Should be in the range 1 to 1000ms,
|
|
# defaults to 1000ms. (Since 8.1)
|
|
#
|
|
+# @vcpu-dirty-limit: Dirtyrate limit (MB/s) during live migration.
|
|
+# Defaults to 1. (Since 8.1)
|
|
+#
|
|
# Features:
|
|
# @unstable: Members @x-checkpoint-delay and @x-vcpu-dirty-limit-period
|
|
# are experimental.
|
|
@@ -982,7 +989,8 @@
|
|
'*multifd-zstd-level': 'uint8',
|
|
'*block-bitmap-mapping': [ 'BitmapMigrationNodeAlias' ],
|
|
'*x-vcpu-dirty-limit-period': { 'type': 'uint64',
|
|
- 'features': [ 'unstable' ] } } }
|
|
+ 'features': [ 'unstable' ] },
|
|
+ '*vcpu-dirty-limit': 'uint64'} }
|
|
|
|
##
|
|
# @migrate-set-parameters:
|
|
@@ -1154,6 +1162,9 @@
|
|
# live migration. Should be in the range 1 to 1000ms,
|
|
# defaults to 1000ms. (Since 8.1)
|
|
#
|
|
+# @vcpu-dirty-limit: Dirtyrate limit (MB/s) during live migration.
|
|
+# Defaults to 1. (Since 8.1)
|
|
+#
|
|
# Features:
|
|
# @unstable: Members @x-checkpoint-delay and @x-vcpu-dirty-limit-period
|
|
# are experimental.
|
|
@@ -1191,7 +1202,8 @@
|
|
'*multifd-zstd-level': 'uint8',
|
|
'*block-bitmap-mapping': [ 'BitmapMigrationNodeAlias' ],
|
|
'*x-vcpu-dirty-limit-period': { 'type': 'uint64',
|
|
- 'features': [ 'unstable' ] } } }
|
|
+ 'features': [ 'unstable' ] },
|
|
+ '*vcpu-dirty-limit': 'uint64'} }
|
|
|
|
##
|
|
# @query-migrate-parameters:
|
|
--
|
|
2.27.0
|
|
|