- 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>
274 lines
10 KiB
Diff
274 lines
10 KiB
Diff
From 6a9933b302c0fb396c6ede78fdef75385e1436e0 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 21:32:59 +0800
|
|
Subject: [PATCH] qapi/migration: Introduce x-vcpu-dirty-limit-period parameter
|
|
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 "x-vcpu-dirty-limit-period" migration experimental
|
|
parameter, which is in the range of 1 to 1000ms and used to
|
|
make dirtyrate calculation period configurable.
|
|
|
|
Currently with the "x-vcpu-dirty-limit-period" varies, the
|
|
total time of live migration changes, test results show the
|
|
optimal value of "x-vcpu-dirty-limit-period" ranges from
|
|
500ms to 1000 ms. "x-vcpu-dirty-limit-period" should be made
|
|
stable once it proves best value can not be determined with
|
|
developer's experiments.
|
|
|
|
Signed-off-by: Hyman Huang(黄勇) <yong.huang@smartx.com>
|
|
Reviewed-by: Markus Armbruster <armbru@redhat.com>
|
|
Reviewed-by: Juan Quintela <quintela@redhat.com>
|
|
Message-Id: <168618975839.6361.17407633874747688653-2@git.sr.ht>
|
|
Signed-off-by: Juan Quintela <quintela@redhat.com>
|
|
---
|
|
migration/migration.c | 53 +++++++++++++++++++++++++++++++++++--------
|
|
migration/migration.h | 1 +
|
|
monitor/hmp-cmds.c | 8 +++++++
|
|
qapi/migration.json | 35 +++++++++++++++++++++-------
|
|
4 files changed, 79 insertions(+), 18 deletions(-)
|
|
|
|
diff --git a/migration/migration.c b/migration/migration.c
|
|
index 7ca5b58839..9672266e16 100644
|
|
--- a/migration/migration.c
|
|
+++ b/migration/migration.c
|
|
@@ -116,6 +116,8 @@
|
|
#define DEFAULT_MIGRATE_ANNOUNCE_ROUNDS 5
|
|
#define DEFAULT_MIGRATE_ANNOUNCE_STEP 100
|
|
|
|
+#define DEFAULT_MIGRATE_VCPU_DIRTY_LIMIT_PERIOD 1000 /* milliseconds */
|
|
+
|
|
static NotifierList migration_state_notifiers =
|
|
NOTIFIER_LIST_INITIALIZER(migration_state_notifiers);
|
|
|
|
@@ -916,6 +918,9 @@ MigrationParameters *qmp_query_migrate_parameters(Error **errp)
|
|
s->parameters.block_bitmap_mapping);
|
|
}
|
|
|
|
+ params->has_x_vcpu_dirty_limit_period = true;
|
|
+ params->x_vcpu_dirty_limit_period = s->parameters.x_vcpu_dirty_limit_period;
|
|
+
|
|
return params;
|
|
}
|
|
|
|
@@ -1499,6 +1504,15 @@ static bool migrate_params_check(MigrationParameters *params, Error **errp)
|
|
return false;
|
|
}
|
|
|
|
+ if (params->has_x_vcpu_dirty_limit_period &&
|
|
+ (params->x_vcpu_dirty_limit_period < 1 ||
|
|
+ params->x_vcpu_dirty_limit_period > 1000)) {
|
|
+ error_setg(errp, QERR_INVALID_PARAMETER_VALUE,
|
|
+ "x-vcpu-dirty-limit-period",
|
|
+ "a value between 1 and 1000");
|
|
+ return false;
|
|
+ }
|
|
+
|
|
return true;
|
|
}
|
|
|
|
@@ -1602,6 +1616,11 @@ static void migrate_params_test_apply(MigrateSetParameters *params,
|
|
dest->has_block_bitmap_mapping = true;
|
|
dest->block_bitmap_mapping = params->block_bitmap_mapping;
|
|
}
|
|
+
|
|
+ if (params->has_x_vcpu_dirty_limit_period) {
|
|
+ dest->x_vcpu_dirty_limit_period =
|
|
+ params->x_vcpu_dirty_limit_period;
|
|
+ }
|
|
}
|
|
|
|
static void migrate_params_apply(MigrateSetParameters *params, Error **errp)
|
|
@@ -1728,6 +1747,11 @@ static void migrate_params_apply(MigrateSetParameters *params, Error **errp)
|
|
QAPI_CLONE(BitmapMigrationNodeAliasList,
|
|
params->block_bitmap_mapping);
|
|
}
|
|
+
|
|
+ if (params->has_x_vcpu_dirty_limit_period) {
|
|
+ s->parameters.x_vcpu_dirty_limit_period =
|
|
+ params->x_vcpu_dirty_limit_period;
|
|
+ }
|
|
}
|
|
|
|
void qmp_migrate_set_parameters(MigrateSetParameters *params, Error **errp)
|
|
@@ -4269,6 +4293,9 @@ static Property migration_properties[] = {
|
|
DEFINE_PROP_SIZE("announce-step", MigrationState,
|
|
parameters.announce_step,
|
|
DEFAULT_MIGRATE_ANNOUNCE_STEP),
|
|
+ DEFINE_PROP_UINT64("x-vcpu-dirty-limit-period", MigrationState,
|
|
+ parameters.x_vcpu_dirty_limit_period,
|
|
+ DEFAULT_MIGRATE_VCPU_DIRTY_LIMIT_PERIOD),
|
|
|
|
/* Migration capabilities */
|
|
DEFINE_PROP_MIG_CAP("x-xbzrle", MIGRATION_CAPABILITY_XBZRLE),
|
|
@@ -4315,17 +4342,8 @@ static void migration_instance_finalize(Object *obj)
|
|
error_free(ms->error);
|
|
}
|
|
|
|
-static void migration_instance_init(Object *obj)
|
|
+void migrate_params_init(MigrationParameters *params)
|
|
{
|
|
- MigrationState *ms = MIGRATION_OBJ(obj);
|
|
- MigrationParameters *params = &ms->parameters;
|
|
-
|
|
- ms->state = MIGRATION_STATUS_NONE;
|
|
- ms->mbps = -1;
|
|
- ms->pages_per_second = -1;
|
|
- qemu_sem_init(&ms->pause_sem, 0);
|
|
- qemu_mutex_init(&ms->error_mutex);
|
|
-
|
|
params->tls_hostname = g_strdup("");
|
|
params->tls_creds = g_strdup("");
|
|
|
|
@@ -4353,6 +4371,21 @@ static void migration_instance_init(Object *obj)
|
|
params->has_announce_max = true;
|
|
params->has_announce_rounds = true;
|
|
params->has_announce_step = true;
|
|
+ params->has_x_vcpu_dirty_limit_period = true;
|
|
+}
|
|
+
|
|
+
|
|
+static void migration_instance_init(Object *obj)
|
|
+{
|
|
+ MigrationState *ms = MIGRATION_OBJ(obj);
|
|
+
|
|
+ ms->state = MIGRATION_STATUS_NONE;
|
|
+ ms->mbps = -1;
|
|
+ ms->pages_per_second = -1;
|
|
+ qemu_sem_init(&ms->pause_sem, 0);
|
|
+ qemu_mutex_init(&ms->error_mutex);
|
|
+
|
|
+ migrate_params_init(&ms->parameters);
|
|
|
|
qemu_sem_init(&ms->postcopy_pause_sem, 0);
|
|
qemu_sem_init(&ms->postcopy_pause_rp_sem, 0);
|
|
diff --git a/migration/migration.h b/migration/migration.h
|
|
index a87fd54d10..6b546a6ac7 100644
|
|
--- a/migration/migration.h
|
|
+++ b/migration/migration.h
|
|
@@ -317,6 +317,7 @@ bool migration_is_setup_or_active(int state);
|
|
bool migration_is_running(int state);
|
|
|
|
void migrate_init(MigrationState *s);
|
|
+void migrate_params_init(MigrationParameters *params);
|
|
bool migration_is_blocked(Error **errp);
|
|
/* True if outgoing migration has entered postcopy phase */
|
|
bool migration_in_postcopy(void);
|
|
diff --git a/monitor/hmp-cmds.c b/monitor/hmp-cmds.c
|
|
index 5246c82e14..680696ddd5 100644
|
|
--- a/monitor/hmp-cmds.c
|
|
+++ b/monitor/hmp-cmds.c
|
|
@@ -516,6 +516,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);
|
|
}
|
|
|
|
qapi_free_MigrationParameters(params);
|
|
@@ -1345,6 +1349,10 @@ void hmp_migrate_set_parameter(Monitor *mon, const QDict *qdict)
|
|
error_setg(&err, "The block-bitmap-mapping parameter can only be set "
|
|
"through QMP");
|
|
break;
|
|
+ case MIGRATION_PARAMETER_X_VCPU_DIRTY_LIMIT_PERIOD:
|
|
+ p->has_x_vcpu_dirty_limit_period = true;
|
|
+ visit_type_size(v, param, &p->x_vcpu_dirty_limit_period, &err);
|
|
+ break;
|
|
default:
|
|
assert(0);
|
|
}
|
|
diff --git a/qapi/migration.json b/qapi/migration.json
|
|
index e965f4329b..b7dc85f7c1 100644
|
|
--- a/qapi/migration.json
|
|
+++ b/qapi/migration.json
|
|
@@ -766,9 +766,13 @@
|
|
# block device name if there is one, and to their node name
|
|
# otherwise. (Since 5.2)
|
|
#
|
|
-# Features:
|
|
-# @unstable: Member @x-checkpoint-delay is experimental.
|
|
+# @x-vcpu-dirty-limit-period: Periodic time (in milliseconds) of dirty limit during
|
|
+# live migration. Should be in the range 1 to 1000ms,
|
|
+# defaults to 1000ms. (Since 8.1)
|
|
#
|
|
+# Features:
|
|
+# @unstable: Members @x-checkpoint-delay and @x-vcpu-dirty-limit-period
|
|
+# are experimental.
|
|
# Since: 2.4
|
|
##
|
|
{ 'enum': 'MigrationParameter',
|
|
@@ -785,8 +789,9 @@
|
|
'multifd-channels',
|
|
'xbzrle-cache-size', 'max-postcopy-bandwidth',
|
|
'max-cpu-throttle', 'multifd-compression',
|
|
- 'multifd-zlib-level' ,'multifd-zstd-level',
|
|
- 'block-bitmap-mapping' ] }
|
|
+ 'multifd-zlib-level', 'multifd-zstd-level',
|
|
+ 'block-bitmap-mapping',
|
|
+ { 'name': 'x-vcpu-dirty-limit-period', 'features': ['unstable'] } ] }
|
|
|
|
##
|
|
# @MigrateSetParameters:
|
|
@@ -934,8 +939,13 @@
|
|
# block device name if there is one, and to their node name
|
|
# otherwise. (Since 5.2)
|
|
#
|
|
+# @x-vcpu-dirty-limit-period: Periodic time (in milliseconds) of dirty limit during
|
|
+# live migration. Should be in the range 1 to 1000ms,
|
|
+# defaults to 1000ms. (Since 8.1)
|
|
+#
|
|
# Features:
|
|
-# @unstable: Member @x-checkpoint-delay is experimental.
|
|
+# @unstable: Members @x-checkpoint-delay and @x-vcpu-dirty-limit-period
|
|
+# are experimental.
|
|
#
|
|
# Since: 2.4
|
|
##
|
|
@@ -970,7 +980,9 @@
|
|
'*multifd-compression': 'MultiFDCompression',
|
|
'*multifd-zlib-level': 'uint8',
|
|
'*multifd-zstd-level': 'uint8',
|
|
- '*block-bitmap-mapping': [ 'BitmapMigrationNodeAlias' ] } }
|
|
+ '*block-bitmap-mapping': [ 'BitmapMigrationNodeAlias' ],
|
|
+ '*x-vcpu-dirty-limit-period': { 'type': 'uint64',
|
|
+ 'features': [ 'unstable' ] } } }
|
|
|
|
##
|
|
# @migrate-set-parameters:
|
|
@@ -1138,8 +1150,13 @@
|
|
# block device name if there is one, and to their node name
|
|
# otherwise. (Since 5.2)
|
|
#
|
|
+# @x-vcpu-dirty-limit-period: Periodic time (in milliseconds) of dirty limit during
|
|
+# live migration. Should be in the range 1 to 1000ms,
|
|
+# defaults to 1000ms. (Since 8.1)
|
|
+#
|
|
# Features:
|
|
-# @unstable: Member @x-checkpoint-delay is experimental.
|
|
+# @unstable: Members @x-checkpoint-delay and @x-vcpu-dirty-limit-period
|
|
+# are experimental.
|
|
#
|
|
# Since: 2.4
|
|
##
|
|
@@ -1172,7 +1189,9 @@
|
|
'*multifd-compression': 'MultiFDCompression',
|
|
'*multifd-zlib-level': 'uint8',
|
|
'*multifd-zstd-level': 'uint8',
|
|
- '*block-bitmap-mapping': [ 'BitmapMigrationNodeAlias' ] } }
|
|
+ '*block-bitmap-mapping': [ 'BitmapMigrationNodeAlias' ],
|
|
+ '*x-vcpu-dirty-limit-period': { 'type': 'uint64',
|
|
+ 'features': [ 'unstable' ] } } }
|
|
|
|
##
|
|
# @query-migrate-parameters:
|
|
--
|
|
2.27.0
|
|
|