qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
To: zhanghailiang <zhang.zhanghailiang@huawei.com>
Cc: lizhijian@cn.fujitsu.com, quintela@redhat.com,
	yunhong.jiang@intel.com, eddie.dong@intel.com,
	peter.huangpeng@huawei.com, qemu-devel@nongnu.org,
	arei.gonglei@huawei.com, amit.shah@redhat.com,
	david@gibson.dropbear.id.au
Subject: Re: [Qemu-devel] [PATCH COLO-Frame v5 25/29] COLO: Add colo-set-checkpoint-period command
Date: Fri, 5 Jun 2015 19:45:51 +0100	[thread overview]
Message-ID: <20150605184551.GJ2139@work-vm> (raw)
In-Reply-To: <1432196001-10352-26-git-send-email-zhang.zhanghailiang@huawei.com>

* zhanghailiang (zhang.zhanghailiang@huawei.com) wrote:
> With this command, we can control the period of checkpoint, if
> there is no comparison of net packets.

This should use the MigrationParameter stuff that's gone into qemu recently;
in my local copy of your code I've got this, and your COLO_MIN period, and the 
delay after a miscompare and your live-ram size threshold all wired in as
MigrationParameters; makes it a lot easier to play with the values.

Dave

> 
> Signed-off-by: zhanghailiang <zhang.zhanghailiang@huawei.com>
> Signed-off-by: Li Zhijian <lizhijian@cn.fujitsu.com>
> ---
>  hmp-commands.hx        | 15 +++++++++++++++
>  hmp.c                  |  7 +++++++
>  hmp.h                  |  1 +
>  migration/colo.c       | 11 ++++++++++-
>  qapi-schema.json       | 13 +++++++++++++
>  qmp-commands.hx        | 22 ++++++++++++++++++++++
>  stubs/migration-colo.c |  4 ++++
>  7 files changed, 72 insertions(+), 1 deletion(-)
> 
> diff --git a/hmp-commands.hx b/hmp-commands.hx
> index be3e398..32cd548 100644
> --- a/hmp-commands.hx
> +++ b/hmp-commands.hx
> @@ -1023,6 +1023,21 @@ Tell COLO that heartbeat is lost, a failover or takeover is needed.
>  ETEXI
>  
>      {
> +        .name       = "colo_set_checkpoint_period",
> +        .args_type  = "value:i",
> +        .params     = "value",
> +        .help       = "set checkpoint period (in ms) for colo. "
> +        "Defaults to 100ms",
> +        .mhandler.cmd = hmp_colo_set_checkpoint_period,
> +    },
> +
> +STEXI
> +@item migrate_set_checkpoint_period @var{value}
> +@findex migrate_set_checkpoint_period
> +Set checkpoint period to @var{value} (in ms) for colo.
> +ETEXI
> +
> +    {
>          .name       = "client_migrate_info",
>          .args_type  = "protocol:s,hostname:s,port:i?,tls-port:i?,cert-subject:s?",
>          .params     = "protocol hostname port tls-port cert-subject",
> diff --git a/hmp.c b/hmp.c
> index f87fa37..f727686 100644
> --- a/hmp.c
> +++ b/hmp.c
> @@ -1257,6 +1257,13 @@ void hmp_colo_lost_heartbeat(Monitor *mon, const QDict *qdict)
>      hmp_handle_error(mon, &err);
>  }
>  
> +void hmp_colo_set_checkpoint_period(Monitor *mon, const QDict *qdict)
> +{
> +    int64_t value = qdict_get_int(qdict, "value");
> +
> +    qmp_colo_set_checkpoint_period(value, NULL);
> +}
> +
>  void hmp_set_password(Monitor *mon, const QDict *qdict)
>  {
>      const char *protocol  = qdict_get_str(qdict, "protocol");
> diff --git a/hmp.h b/hmp.h
> index b6549f8..9570345 100644
> --- a/hmp.h
> +++ b/hmp.h
> @@ -68,6 +68,7 @@ void hmp_migrate_set_capability(Monitor *mon, const QDict *qdict);
>  void hmp_migrate_set_parameter(Monitor *mon, const QDict *qdict);
>  void hmp_migrate_set_cache_size(Monitor *mon, const QDict *qdict);
>  void hmp_colo_lost_heartbeat(Monitor *mon, const QDict *qdict);
> +void hmp_colo_set_checkpoint_period(Monitor *mon, const QDict *qdict);
>  void hmp_set_password(Monitor *mon, const QDict *qdict);
>  void hmp_expire_password(Monitor *mon, const QDict *qdict);
>  void hmp_eject(Monitor *mon, const QDict *qdict);
> diff --git a/migration/colo.c b/migration/colo.c
> index 195973a..f5fc79c 100644
> --- a/migration/colo.c
> +++ b/migration/colo.c
> @@ -17,6 +17,7 @@
>  #include "qemu/error-report.h"
>  #include "migration/migration-failover.h"
>  #include "net/colo-nic.h"
> +#include "qmp-commands.h"
>  
>  /*
>  * We should not do checkpoint one after another without any time interval,
> @@ -70,6 +71,9 @@ enum {
>  static QEMUBH *colo_bh;
>  static bool vmstate_loading;
>  static Coroutine *colo;
> +
> +int64_t colo_checkpoint_period = CHECKPOINT_MAX_PEROID;
> +
>  /* colo buffer */
>  #define COLO_BUFFER_BASE_SIZE (4 * 1024 * 1024)
>  QEMUSizedBuffer *colo_buffer;
> @@ -85,6 +89,11 @@ bool migrate_in_colo_state(void)
>      return (s->state == MIGRATION_STATUS_COLO);
>  }
>  
> +void qmp_colo_set_checkpoint_period(int64_t value, Error **errp)
> +{
> +    colo_checkpoint_period = value;
> +}
> +
>  static bool colo_runstate_is_stopped(void)
>  {
>      return runstate_check(RUN_STATE_COLO) || !runstate_is_running();
> @@ -361,7 +370,7 @@ static void *colo_thread(void *opaque)
>           * and then check if we need checkpoint again.
>           */
>          current_time = qemu_clock_get_ms(QEMU_CLOCK_HOST);
> -        if (current_time - checkpoint_time < CHECKPOINT_MAX_PEROID) {
> +        if (current_time - checkpoint_time < colo_checkpoint_period) {
>              g_usleep(100000);
>              continue;
>          }
> diff --git a/qapi-schema.json b/qapi-schema.json
> index dc0ee07..62b5cfd 100644
> --- a/qapi-schema.json
> +++ b/qapi-schema.json
> @@ -653,6 +653,19 @@
>  { 'command': 'colo-lost-heartbeat' }
>  
>  ##
> +# @colo-set-checkpoint-period
> +#
> +# Set colo checkpoint period
> +#
> +# @value: period of colo checkpoint in ms
> +#
> +# Returns: nothing on success
> +#
> +# Since: 2.4
> +##
> +{ 'command': 'colo-set-checkpoint-period', 'data': {'value': 'int'} }
> +
> +##
>  # @MouseInfo:
>  #
>  # Information about a mouse device.
> diff --git a/qmp-commands.hx b/qmp-commands.hx
> index 3813f66..4b16044 100644
> --- a/qmp-commands.hx
> +++ b/qmp-commands.hx
> @@ -800,6 +800,28 @@ Example:
>  EQMP
>  
>      {
> +         .name       = "colo-set-checkpoint-period",
> +         .args_type  = "value:i",
> +         .mhandler.cmd_new = qmp_marshal_input_colo_set_checkpoint_period,
> +    },
> +
> +SQMP
> +colo-set-checkpoint-period
> +--------------------------
> +
> +set checkpoint period
> +
> +Arguments:
> +- "value": checkpoint period
> +
> +Example:
> +
> +-> { "execute": "colo-set-checkpoint-period", "arguments": { "value": "1000" } }
> +<- { "return": {} }
> +
> +EQMP
> +
> +    {
>          .name       = "client_migrate_info",
>          .args_type  = "protocol:s,hostname:s,port:i?,tls-port:i?,cert-subject:s?",
>          .params     = "protocol hostname port tls-port cert-subject",
> diff --git a/stubs/migration-colo.c b/stubs/migration-colo.c
> index 03a395b..d3c9dc4 100644
> --- a/stubs/migration-colo.c
> +++ b/stubs/migration-colo.c
> @@ -52,3 +52,7 @@ void qmp_colo_lost_heartbeat(Error **errp)
>                       " with --enable-colo option in order to support"
>                       " COLO feature");
>  }
> +
> +void qmp_colo_set_checkpoint_period(int64_t value, Error **errp)
> +{
> +}
> -- 
> 1.7.12.4
> 
> 
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK

  reply	other threads:[~2015-06-05 18:46 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-21  8:12 [Qemu-devel] [PATCH COLO-Frame v5 00/29] COarse-grain LOck-stepping(COLO) Virtual Machines for Non-stop Service zhanghailiang
2015-05-21  8:12 ` [Qemu-devel] [PATCH COLO-Frame v5 01/29] configure: Add parameter for configure to enable/disable COLO support zhanghailiang
2015-05-21  8:12 ` [Qemu-devel] [PATCH COLO-Frame v5 02/29] migration: Introduce capability 'colo' to migration zhanghailiang
2015-05-21  8:12 ` [Qemu-devel] [PATCH COLO-Frame v5 03/29] COLO: migrate colo related info to slave zhanghailiang
2015-05-21  8:12 ` [Qemu-devel] [PATCH COLO-Frame v5 04/29] migration: Integrate COLO checkpoint process into migration zhanghailiang
2015-05-21  8:12 ` [Qemu-devel] [PATCH COLO-Frame v5 05/29] migration: Integrate COLO checkpoint process into loadvm zhanghailiang
2015-05-21  8:12 ` [Qemu-devel] [PATCH COLO-Frame v5 06/29] COLO: Implement colo checkpoint protocol zhanghailiang
2015-05-21  8:12 ` [Qemu-devel] [PATCH COLO-Frame v5 07/29] COLO: Add a new RunState RUN_STATE_COLO zhanghailiang
2015-05-21  8:13 ` [Qemu-devel] [PATCH COLO-Frame v5 08/29] QEMUSizedBuffer: Introduce two help functions for qsb zhanghailiang
2015-05-21  8:13 ` [Qemu-devel] [PATCH COLO-Frame v5 09/29] COLO: Save VM state to slave when do checkpoint zhanghailiang
2015-05-21  8:13 ` [Qemu-devel] [PATCH COLO-Frame v5 10/29] COLO RAM: Load PVM's dirty page into SVM's RAM cache temporarily zhanghailiang
2015-05-21  8:13 ` [Qemu-devel] [PATCH COLO-Frame v5 11/29] COLO VMstate: Load VM state into qsb before restore it zhanghailiang
2015-06-05 18:02   ` Dr. David Alan Gilbert
2015-06-09  2:19     ` zhanghailiang
2015-05-21  8:13 ` [Qemu-devel] [PATCH COLO-Frame v5 12/29] arch_init: Start to trace dirty pages of SVM zhanghailiang
2015-05-21  8:13 ` [Qemu-devel] [PATCH COLO-Frame v5 13/29] COLO RAM: Flush cached RAM into SVM's memory zhanghailiang
2015-05-21  8:13 ` [Qemu-devel] [PATCH COLO-Frame v5 14/29] COLO failover: Introduce a new command to trigger a failover zhanghailiang
2015-05-21  8:13 ` [Qemu-devel] [PATCH COLO-Frame v5 15/29] COLO failover: Implement COLO master/slave failover work zhanghailiang
2015-05-21  8:13 ` [Qemu-devel] [PATCH COLO-Frame v5 16/29] COLO failover: Don't do failover during loading VM's state zhanghailiang
2015-05-21  8:13 ` [Qemu-devel] [PATCH COLO-Frame v5 17/29] COLO: Add new command parameter 'colo_nicname' 'colo_script' for net zhanghailiang
2015-05-21  8:13 ` [Qemu-devel] [PATCH COLO-Frame v5 18/29] COLO NIC: Init/remove colo nic devices when add/cleanup tap devices zhanghailiang
2015-05-21  8:13 ` [Qemu-devel] [PATCH COLO-Frame v5 19/29] COLO NIC: Implement colo nic device interface configure() zhanghailiang
2015-05-21  8:13 ` [Qemu-devel] [PATCH COLO-Frame v5 20/29] COLO NIC : Implement colo nic init/destroy function zhanghailiang
2015-05-21  8:13 ` [Qemu-devel] [PATCH COLO-Frame v5 21/29] COLO NIC: Some init work related with proxy module zhanghailiang
2015-05-21  8:13 ` [Qemu-devel] [PATCH COLO-Frame v5 22/29] COLO: Handle nfnetlink message from " zhanghailiang
2015-05-21  8:13 ` [Qemu-devel] [PATCH COLO-Frame v5 23/29] COLO: Do checkpoint according to the result of packets comparation zhanghailiang
2015-05-21  8:13 ` [Qemu-devel] [PATCH COLO-Frame v5 24/29] COLO: Improve checkpoint efficiency by do additional periodic checkpoint zhanghailiang
2015-05-21  8:13 ` [Qemu-devel] [PATCH COLO-Frame v5 25/29] COLO: Add colo-set-checkpoint-period command zhanghailiang
2015-06-05 18:45   ` Dr. David Alan Gilbert [this message]
2015-06-09  3:28     ` zhanghailiang
2015-06-09  8:01       ` Dr. David Alan Gilbert
2015-06-09 10:14         ` zhanghailiang
2015-05-21  8:13 ` [Qemu-devel] [PATCH COLO-Frame v5 26/29] COLO NIC: Implement NIC checkpoint and failover zhanghailiang
2015-05-21  8:13 ` [Qemu-devel] [PATCH COLO-Frame v5 27/29] COLO: Disable qdev hotplug when VM is in COLO mode zhanghailiang
2015-05-21  8:13 ` [Qemu-devel] [PATCH COLO-Frame v5 28/29] COLO: Implement shutdown checkpoint zhanghailiang
2015-05-21  8:13 ` [Qemu-devel] [PATCH COLO-Frame v5 29/29] COLO: Add block replication into colo process zhanghailiang
2015-05-21 11:30 ` [Qemu-devel] [PATCH COLO-Frame v5 00/29] COarse-grain LOck-stepping(COLO) Virtual Machines for Non-stop Service Dr. David Alan Gilbert
2015-05-22  6:26   ` zhanghailiang
2015-05-28 16:24 ` Dr. David Alan Gilbert
2015-05-29  1:29   ` Wen Congyang
2015-05-29  8:01     ` Dr. David Alan Gilbert
2015-05-29  8:06     ` zhanghailiang
2015-05-29  8:42       ` Dr. David Alan Gilbert
     [not found]         ` <55685CCA.2010604@cn.fujitsu.com>
2015-05-29 15:12           ` Dr. David Alan Gilbert
2015-06-01  1:41         ` Wen Congyang
2015-06-01  9:16           ` Dr. David Alan Gilbert
2015-06-02  3:51   ` Wen Congyang
2015-06-02  8:02     ` Dr. David Alan Gilbert

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=20150605184551.GJ2139@work-vm \
    --to=dgilbert@redhat.com \
    --cc=amit.shah@redhat.com \
    --cc=arei.gonglei@huawei.com \
    --cc=david@gibson.dropbear.id.au \
    --cc=eddie.dong@intel.com \
    --cc=lizhijian@cn.fujitsu.com \
    --cc=peter.huangpeng@huawei.com \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    --cc=yunhong.jiang@intel.com \
    --cc=zhang.zhanghailiang@huawei.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).