From: zhanghailiang <zhang.zhanghailiang@huawei.com>
To: qemu-devel@nongnu.org
Cc: xiecl.fnst@cn.fujitsu.com, lizhijian@cn.fujitsu.com,
quintela@redhat.com, armbru@redhat.com, yunhong.jiang@intel.com,
eddie.dong@intel.com, peter.huangpeng@huawei.com,
dgilbert@redhat.com,
zhanghailiang <zhang.zhanghailiang@huawei.com>,
arei.gonglei@huawei.com, stefanha@redhat.com,
amit.shah@redhat.com, zhangchen.fnst@cn.fujitsu.com,
Luiz Capitulino <lcapitulino@redhat.com>,
hongyang.yang@easystack.cn
Subject: [Qemu-devel] [PATCH COLO-Frame v14 15/40] COLO: Add checkpoint-delay parameter for migrate-set-parameters
Date: Sat, 6 Feb 2016 17:28:27 +0800 [thread overview]
Message-ID: <1454750932-7556-16-git-send-email-zhang.zhanghailiang@huawei.com> (raw)
In-Reply-To: <1454750932-7556-1-git-send-email-zhang.zhanghailiang@huawei.com>
Add checkpoint-delay parameter for migrate-set-parameters, so that
we can control the checkpoint frequency when COLO is in periodic mode.
Cc: Luiz Capitulino <lcapitulino@redhat.com>
Cc: Eric Blake <eblake@redhat.com>
Cc: Markus Armbruster <armbru@redhat.com>
Signed-off-by: zhanghailiang <zhang.zhanghailiang@huawei.com>
Signed-off-by: Li Zhijian <lizhijian@cn.fujitsu.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
---
v12:
- Change checkpoint-delay to x-checkpoint-delay (Dave's suggestion)
- Add Reviewed-by tag
v11:
- Move this patch ahead of the patch where uses 'checkpoint_delay'
(Dave's suggestion)
v10:
- Fix related qmp command
---
hmp.c | 7 +++++++
migration/migration.c | 24 +++++++++++++++++++++++-
qapi-schema.json | 19 ++++++++++++++++---
qmp-commands.hx | 3 ++-
4 files changed, 48 insertions(+), 5 deletions(-)
diff --git a/hmp.c b/hmp.c
index cb03a15..fc01a05 100644
--- a/hmp.c
+++ b/hmp.c
@@ -284,6 +284,9 @@ void hmp_info_migrate_parameters(Monitor *mon, const QDict *qdict)
monitor_printf(mon, " %s: %" PRId64,
MigrationParameter_lookup[MIGRATION_PARAMETER_X_CPU_THROTTLE_INCREMENT],
params->x_cpu_throttle_increment);
+ monitor_printf(mon, " %s: %" PRId64,
+ MigrationParameter_lookup[MIGRATION_PARAMETER_X_CHECKPOINT_DELAY],
+ params->x_checkpoint_delay);
monitor_printf(mon, "\n");
}
@@ -1238,6 +1241,7 @@ void hmp_migrate_set_parameter(Monitor *mon, const QDict *qdict)
bool has_decompress_threads = false;
bool has_x_cpu_throttle_initial = false;
bool has_x_cpu_throttle_increment = false;
+ bool has_x_checkpoint_delay = false;
int i;
for (i = 0; i < MIGRATION_PARAMETER__MAX; i++) {
@@ -1257,6 +1261,8 @@ void hmp_migrate_set_parameter(Monitor *mon, const QDict *qdict)
break;
case MIGRATION_PARAMETER_X_CPU_THROTTLE_INCREMENT:
has_x_cpu_throttle_increment = true;
+ case MIGRATION_PARAMETER_X_CHECKPOINT_DELAY:
+ has_x_checkpoint_delay = true;
break;
}
qmp_migrate_set_parameters(has_compress_level, value,
@@ -1264,6 +1270,7 @@ void hmp_migrate_set_parameter(Monitor *mon, const QDict *qdict)
has_decompress_threads, value,
has_x_cpu_throttle_initial, value,
has_x_cpu_throttle_increment, value,
+ has_x_checkpoint_delay, value,
&err);
break;
}
diff --git a/migration/migration.c b/migration/migration.c
index 32d4f51..5833baf 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -57,6 +57,11 @@
/* Migration XBZRLE default cache size */
#define DEFAULT_MIGRATE_CACHE_SIZE (64 * 1024 * 1024)
+/* The delay time (in ms) between two COLO checkpoints
+ * Note: Please change this default value to 10000 when we support hybrid mode.
+ */
+#define DEFAULT_MIGRATE_X_CHECKPOINT_DELAY 200
+
static NotifierList migration_state_notifiers =
NOTIFIER_LIST_INITIALIZER(migration_state_notifiers);
@@ -92,6 +97,8 @@ MigrationState *migrate_get_current(void)
DEFAULT_MIGRATE_X_CPU_THROTTLE_INITIAL,
.parameters[MIGRATION_PARAMETER_X_CPU_THROTTLE_INCREMENT] =
DEFAULT_MIGRATE_X_CPU_THROTTLE_INCREMENT,
+ .parameters[MIGRATION_PARAMETER_X_CHECKPOINT_DELAY] =
+ DEFAULT_MIGRATE_X_CHECKPOINT_DELAY,
};
if (!once) {
@@ -531,6 +538,8 @@ MigrationParameters *qmp_query_migrate_parameters(Error **errp)
s->parameters[MIGRATION_PARAMETER_X_CPU_THROTTLE_INITIAL];
params->x_cpu_throttle_increment =
s->parameters[MIGRATION_PARAMETER_X_CPU_THROTTLE_INCREMENT];
+ params->x_checkpoint_delay =
+ s->parameters[MIGRATION_PARAMETER_X_CHECKPOINT_DELAY];
return params;
}
@@ -738,7 +747,10 @@ void qmp_migrate_set_parameters(bool has_compress_level,
bool has_x_cpu_throttle_initial,
int64_t x_cpu_throttle_initial,
bool has_x_cpu_throttle_increment,
- int64_t x_cpu_throttle_increment, Error **errp)
+ int64_t x_cpu_throttle_increment,
+ bool has_x_checkpoint_delay,
+ int64_t x_checkpoint_delay,
+ Error **errp)
{
MigrationState *s = migrate_get_current();
@@ -773,6 +785,11 @@ void qmp_migrate_set_parameters(bool has_compress_level,
"x_cpu_throttle_increment",
"an integer in the range of 1 to 99");
}
+ if (has_x_checkpoint_delay && (x_checkpoint_delay < 0)) {
+ error_setg(errp, QERR_INVALID_PARAMETER_VALUE,
+ "x_checkpoint_delay",
+ "is invalid, it should be positive");
+ }
if (has_compress_level) {
s->parameters[MIGRATION_PARAMETER_COMPRESS_LEVEL] = compress_level;
@@ -793,6 +810,11 @@ void qmp_migrate_set_parameters(bool has_compress_level,
s->parameters[MIGRATION_PARAMETER_X_CPU_THROTTLE_INCREMENT] =
x_cpu_throttle_increment;
}
+
+ if (has_x_checkpoint_delay) {
+ s->parameters[MIGRATION_PARAMETER_X_CHECKPOINT_DELAY] =
+ x_checkpoint_delay;
+ }
}
void qmp_migrate_start_postcopy(Error **errp)
diff --git a/qapi-schema.json b/qapi-schema.json
index 935870d..582407d 100644
--- a/qapi-schema.json
+++ b/qapi-schema.json
@@ -621,11 +621,16 @@
# @x-cpu-throttle-increment: throttle percentage increase each time
# auto-converge detects that migration is not making
# progress. The default value is 10. (Since 2.5)
+#
+# @x-checkpoint-delay: The delay time (in ms) between two COLO checkpoints in
+# periodic mode. (Since 2.6)
+#
# Since: 2.4
##
{ 'enum': 'MigrationParameter',
'data': ['compress-level', 'compress-threads', 'decompress-threads',
- 'x-cpu-throttle-initial', 'x-cpu-throttle-increment'] }
+ 'x-cpu-throttle-initial', 'x-cpu-throttle-increment',
+ 'x-checkpoint-delay' ] }
#
# @migrate-set-parameters
@@ -645,6 +650,9 @@
# @x-cpu-throttle-increment: throttle percentage increase each time
# auto-converge detects that migration is not making
# progress. The default value is 10. (Since 2.5)
+#
+# @x-checkpoint-delay: the delay time between two checkpoints. (Since 2.6)
+#
# Since: 2.4
##
{ 'command': 'migrate-set-parameters',
@@ -652,7 +660,8 @@
'*compress-threads': 'int',
'*decompress-threads': 'int',
'*x-cpu-throttle-initial': 'int',
- '*x-cpu-throttle-increment': 'int'} }
+ '*x-cpu-throttle-increment': 'int',
+ '*x-checkpoint-delay': 'int' } }
#
# @MigrationParameters
@@ -671,6 +680,8 @@
# auto-converge detects that migration is not making
# progress. The default value is 10. (Since 2.5)
#
+# @x-checkpoint-delay: the delay time between two COLO checkpoints. (Since 2.6)
+#
# Since: 2.4
##
{ 'struct': 'MigrationParameters',
@@ -678,7 +689,9 @@
'compress-threads': 'int',
'decompress-threads': 'int',
'x-cpu-throttle-initial': 'int',
- 'x-cpu-throttle-increment': 'int'} }
+ 'x-cpu-throttle-increment': 'int',
+ 'x-checkpoint-delay': 'int'} }
+
##
# @query-migrate-parameters
#
diff --git a/qmp-commands.hx b/qmp-commands.hx
index dabc557..64595cd 100644
--- a/qmp-commands.hx
+++ b/qmp-commands.hx
@@ -3718,6 +3718,7 @@ Set migration parameters
throttled for auto-converge (json-int)
- "x-cpu-throttle-increment": set throttle increasing percentage for
auto-converge (json-int)
+- "x-checkpoint-delay": set the delay time for periodic checkpoint (json-int)
Arguments:
@@ -3731,7 +3732,7 @@ EQMP
{
.name = "migrate-set-parameters",
.args_type =
- "compress-level:i?,compress-threads:i?,decompress-threads:i?,x-cpu-throttle-initial:i?,x-cpu-throttle-increment:i?",
+ "compress-level:i?,compress-threads:i?,decompress-threads:i?,x-cpu-throttle-initial:i?,x-cpu-throttle-increment:i?,x-checkpoint-delay:i?",
.mhandler.cmd_new = qmp_marshal_migrate_set_parameters,
},
SQMP
--
1.8.3.1
next prev parent reply other threads:[~2016-02-06 9:29 UTC|newest]
Thread overview: 60+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-06 9:28 [Qemu-devel] [PATCH COLO-Frame v14 00/40] COarse-grain LOck-stepping(COLO) Virtual Machines for Non-stop Service (FT) zhanghailiang
2016-02-06 9:28 ` [Qemu-devel] [PATCH COLO-Frame v14 01/40] configure: Add parameter for configure to enable/disable COLO support zhanghailiang
2016-02-06 9:28 ` [Qemu-devel] [PATCH COLO-Frame v14 02/40] migration: Introduce capability 'x-colo' to migration zhanghailiang
2016-02-06 9:28 ` [Qemu-devel] [PATCH COLO-Frame v14 03/40] COLO: migrate colo related info to secondary node zhanghailiang
2016-02-06 9:28 ` [Qemu-devel] [PATCH COLO-Frame v14 04/40] migration: Integrate COLO checkpoint process into migration zhanghailiang
2016-02-06 9:28 ` [Qemu-devel] [PATCH COLO-Frame v14 05/40] migration: Integrate COLO checkpoint process into loadvm zhanghailiang
2016-02-06 9:28 ` [Qemu-devel] [PATCH COLO-Frame v14 06/40] COLO/migration: Create a new communication path from destination to source zhanghailiang
2016-02-06 9:28 ` [Qemu-devel] [PATCH COLO-Frame v14 07/40] COLO: Implement colo checkpoint protocol zhanghailiang
2016-02-06 9:28 ` [Qemu-devel] [PATCH COLO-Frame v14 08/40] COLO: Add a new RunState RUN_STATE_COLO zhanghailiang
2016-02-06 9:28 ` [Qemu-devel] [PATCH COLO-Frame v14 09/40] QEMUSizedBuffer: Introduce two help functions for qsb zhanghailiang
2016-02-06 9:28 ` [Qemu-devel] [PATCH COLO-Frame v14 10/40] COLO: Save PVM state to secondary side when do checkpoint zhanghailiang
2016-02-06 9:28 ` [Qemu-devel] [PATCH COLO-Frame v14 11/40] COLO: Load PVM's dirty pages into SVM's RAM cache temporarily zhanghailiang
2016-02-06 9:28 ` [Qemu-devel] [PATCH COLO-Frame v14 12/40] ram/COLO: Record the dirty pages that SVM received zhanghailiang
2016-02-06 9:28 ` [Qemu-devel] [PATCH COLO-Frame v14 13/40] COLO: Load VMState into qsb before restore it zhanghailiang
2016-02-06 9:28 ` [Qemu-devel] [PATCH COLO-Frame v14 14/40] COLO: Flush PVM's cached RAM into SVM's memory zhanghailiang
2016-02-06 9:28 ` zhanghailiang [this message]
2016-02-06 9:28 ` [Qemu-devel] [PATCH COLO-Frame v14 16/40] COLO: synchronize PVM's state to SVM periodically zhanghailiang
2016-02-06 9:28 ` [Qemu-devel] [PATCH COLO-Frame v14 17/40] COLO failover: Introduce a new command to trigger a failover zhanghailiang
2016-02-06 9:28 ` [Qemu-devel] [PATCH COLO-Frame v14 18/40] COLO failover: Introduce state to record failover process zhanghailiang
2016-02-06 9:28 ` [Qemu-devel] [PATCH COLO-Frame v14 19/40] COLO: Implement failover work for Primary VM zhanghailiang
2016-02-06 9:28 ` [Qemu-devel] [PATCH COLO-Frame v14 20/40] COLO: Implement failover work for Secondary VM zhanghailiang
2016-02-06 9:28 ` [Qemu-devel] [PATCH COLO-Frame v14 21/40] qmp event: Add COLO_EXIT event to notify users while exited from COLO zhanghailiang
2016-02-06 9:28 ` [Qemu-devel] [PATCH COLO-Frame v14 22/40] COLO failover: Shutdown related socket fd when do failover zhanghailiang
2016-02-06 9:28 ` [Qemu-devel] [PATCH COLO-Frame v14 23/40] COLO failover: Don't do failover during loading VM's state zhanghailiang
2016-02-06 9:28 ` [Qemu-devel] [PATCH COLO-Frame v14 24/40] COLO: Process shutdown command for VM in COLO state zhanghailiang
2016-02-12 15:09 ` Dr. David Alan Gilbert
2016-02-16 6:17 ` Hailiang Zhang
2016-02-06 9:28 ` [Qemu-devel] [PATCH COLO-Frame v14 25/40] COLO: Update the global runstate after going into colo state zhanghailiang
2016-02-06 9:28 ` [Qemu-devel] [PATCH COLO-Frame v14 26/40] savevm: Introduce two helper functions for save/find loadvm_handlers entry zhanghailiang
2016-02-06 9:28 ` [Qemu-devel] [PATCH COLO-Frame v14 27/40] migration/savevm: Add new helpers to process the different stages of loadvm zhanghailiang
2016-02-06 9:28 ` [Qemu-devel] [PATCH COLO-Frame v14 28/40] migration/savevm: Export two helper functions for savevm process zhanghailiang
2016-02-06 9:28 ` [Qemu-devel] [PATCH COLO-Frame v14 29/40] COLO: Separate the process of saving/loading ram and device state zhanghailiang
2016-02-06 9:28 ` [Qemu-devel] [PATCH COLO-Frame v14 30/40] COLO: Split qemu_savevm_state_begin out of checkpoint process zhanghailiang
2016-02-06 9:28 ` [Qemu-devel] [PATCH COLO-Frame v14 31/40] net/filter: Add a 'status' property for filter object zhanghailiang
2016-02-18 3:00 ` Jason Wang
2016-02-18 3:27 ` Hailiang Zhang
2016-02-23 8:34 ` Jason Wang
2016-02-23 9:37 ` Hailiang Zhang
2016-02-06 9:28 ` [Qemu-devel] [PATCH COLO-Frame v14 32/40] net/filter: Introduce a helper to add a filter to the netdev zhanghailiang
2016-02-18 3:19 ` Jason Wang
2016-02-18 3:30 ` Hailiang Zhang
2016-02-23 8:36 ` Jason Wang
2016-02-23 11:39 ` Hailiang Zhang
2016-02-23 11:50 ` Hailiang Zhang
2016-02-06 9:28 ` [Qemu-devel] [PATCH COLO-Frame v14 33/40] filter-buffer: Accept zero interval zhanghailiang
2016-02-06 9:28 ` [Qemu-devel] [PATCH COLO-Frame v14 34/40] net: Add notifier/callback for netdev init zhanghailiang
2016-02-06 9:28 ` [Qemu-devel] [PATCH COLO-Frame v14 35/40] COLO/filter: add each netdev a buffer filter zhanghailiang
2016-02-18 3:23 ` Jason Wang
2016-02-18 4:07 ` Hailiang Zhang
2016-02-06 9:28 ` [Qemu-devel] [PATCH COLO-Frame v14 36/40] net/filter: Add a helper to traverse all the filters zhanghailiang
2016-02-06 9:28 ` [Qemu-devel] [PATCH COLO-Frame v14 37/40] COLO: enable buffer filters for PVM zhanghailiang
2016-02-18 3:31 ` Jason Wang
2016-02-18 3:46 ` Hailiang Zhang
2016-02-18 7:30 ` Hailiang Zhang
2016-02-23 8:38 ` Jason Wang
2016-02-23 9:10 ` Hailiang Zhang
2016-02-23 8:37 ` Jason Wang
2016-02-06 9:28 ` [Qemu-devel] [PATCH COLO-Frame v14 38/40] filter-buffer: make filter_buffer_flush() public zhanghailiang
2016-02-06 9:28 ` [Qemu-devel] [PATCH COLO-Frame v14 39/40] COLO: flush buffered packets in checkpoint process or exit COLO zhanghailiang
2016-02-06 9:28 ` [Qemu-devel] [PATCH COLO-Frame v14 40/40] COLO: Add block replication into colo process zhanghailiang
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=1454750932-7556-16-git-send-email-zhang.zhanghailiang@huawei.com \
--to=zhang.zhanghailiang@huawei.com \
--cc=amit.shah@redhat.com \
--cc=arei.gonglei@huawei.com \
--cc=armbru@redhat.com \
--cc=dgilbert@redhat.com \
--cc=eddie.dong@intel.com \
--cc=hongyang.yang@easystack.cn \
--cc=lcapitulino@redhat.com \
--cc=lizhijian@cn.fujitsu.com \
--cc=peter.huangpeng@huawei.com \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.com \
--cc=stefanha@redhat.com \
--cc=xiecl.fnst@cn.fujitsu.com \
--cc=yunhong.jiang@intel.com \
--cc=zhangchen.fnst@cn.fujitsu.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).