All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
To: zhanghailiang <zhang.zhanghailiang@huawei.com>
Cc: danielcho@qnap.com, qemu-devel@nongnu.org, quintela@redhat.com
Subject: Re: [PATCH V2 8/8] migration/colo: Only flush ram cache while do checkpoint
Date: Thu, 12 Mar 2020 19:51:40 +0000	[thread overview]
Message-ID: <20200312195140.GQ3211@work-vm> (raw)
In-Reply-To: <20200224065414.36524-9-zhang.zhanghailiang@huawei.com>

* zhanghailiang (zhang.zhanghailiang@huawei.com) wrote:
> After add migrating ram backgroud, we will call ram_load
> for this process, but we should not flush ram cache during
> this process. Move the flush action to the right place.
> 
> Signed-off-by: zhanghailiang <zhang.zhanghailiang@huawei.com>

Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>

> ---
>  migration/colo.c | 1 +
>  migration/ram.c  | 5 +----
>  migration/ram.h  | 1 +
>  3 files changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/migration/colo.c b/migration/colo.c
> index c36d94072f..18df8289f8 100644
> --- a/migration/colo.c
> +++ b/migration/colo.c
> @@ -799,6 +799,7 @@ static void colo_incoming_process_checkpoint(MigrationIncomingState *mis,
>  
>      qemu_mutex_lock_iothread();
>      vmstate_loading = true;
> +    colo_flush_ram_cache();
>      ret = qemu_load_device_state(fb);
>      if (ret < 0) {
>          error_setg(errp, "COLO: load device state failed");
> diff --git a/migration/ram.c b/migration/ram.c
> index 1b3f423351..7bc841d14f 100644
> --- a/migration/ram.c
> +++ b/migration/ram.c
> @@ -3305,7 +3305,7 @@ static bool postcopy_is_running(void)
>   * Flush content of RAM cache into SVM's memory.
>   * Only flush the pages that be dirtied by PVM or SVM or both.
>   */
> -static void colo_flush_ram_cache(void)
> +void colo_flush_ram_cache(void)
>  {
>      RAMBlock *block = NULL;
>      void *dst_host;
> @@ -3576,9 +3576,6 @@ static int ram_load(QEMUFile *f, void *opaque, int version_id)
>      }
>      trace_ram_load_complete(ret, seq_iter);
>  
> -    if (!ret  && migration_incoming_in_colo_state()) {
> -        colo_flush_ram_cache();
> -    }
>      return ret;
>  }
>  
> diff --git a/migration/ram.h b/migration/ram.h
> index 5ceaff7cb4..ae14341482 100644
> --- a/migration/ram.h
> +++ b/migration/ram.h
> @@ -67,5 +67,6 @@ int ram_dirty_bitmap_reload(MigrationState *s, RAMBlock *rb);
>  int colo_init_ram_cache(void);
>  void colo_release_ram_cache(void);
>  void colo_incoming_start_dirty_log(void);
> +void colo_flush_ram_cache(void);
>  
>  #endif
> -- 
> 2.21.0
> 
> 
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK



      reply	other threads:[~2020-03-12 19:59 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-24  6:54 [PATCH V2 0/8] Optimize VM's downtime while do checkpoint in COLO zhanghailiang
2020-02-24  6:54 ` [PATCH V2 1/8] migration: fix COLO broken caused by a previous commit zhanghailiang
2020-02-27 18:36   ` Juan Quintela
2020-02-24  6:54 ` [PATCH V2 2/8] migration/colo: wrap incoming checkpoint process into new helper zhanghailiang
2020-02-24  6:54 ` [PATCH V2 3/8] savevm: Don't call colo_init_ram_cache twice zhanghailiang
2020-02-27 18:37   ` Juan Quintela
2020-02-24  6:54 ` [PATCH V2 4/8] COLO: Optimize memory back-up process zhanghailiang
2020-02-25  2:52   ` Daniel Cho
2020-02-25  3:56     ` Zhanghailiang
2020-03-12 18:44   ` Dr. David Alan Gilbert
2020-02-24  6:54 ` [PATCH V2 5/8] ram/colo: only record bitmap of dirty pages in COLO stage zhanghailiang
2020-03-12 18:55   ` Dr. David Alan Gilbert
2020-02-24  6:54 ` [PATCH V2 6/8] migration: recognize COLO as part of activating process zhanghailiang
2020-03-12 19:42   ` Dr. David Alan Gilbert
2020-02-24  6:54 ` [PATCH V2 7/8] COLO: Migrate dirty pages during the gap of checkpointing zhanghailiang
2020-02-24 15:18   ` Eric Blake
2020-02-25  1:07     ` Zhanghailiang
2020-03-12 19:50   ` Dr. David Alan Gilbert
2020-02-24  6:54 ` [PATCH V2 8/8] migration/colo: Only flush ram cache while do checkpoint zhanghailiang
2020-03-12 19:51   ` Dr. David Alan Gilbert [this message]

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=20200312195140.GQ3211@work-vm \
    --to=dgilbert@redhat.com \
    --cc=danielcho@qnap.com \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.