All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Xu <peterx@redhat.com>
To: Yuan Liu <yuan1.liu@intel.com>
Cc: farosas@suse.de, qemu-devel@nongnu.org, jason.zeng@intel.com,
	yichen.wang@bytedance.com
Subject: Re: [PATCH 1/3] multifd: bugfix for migration using compression methods
Date: Wed, 18 Dec 2024 12:03:14 -0500	[thread overview]
Message-ID: <Z2MAUj-ComKI2HUE@x1n> (raw)
In-Reply-To: <20241218091413.140396-2-yuan1.liu@intel.com>

On Wed, Dec 18, 2024 at 05:14:11PM +0800, Yuan Liu wrote:
> When compression is enabled on the migration channel and
> the pages processed are all zero pages, these pages will
> not be sent and updated on the target side, resulting in
> incorrect memory data on the source and target sides.
> 
> The root cause is that all compression methods call
> multifd_send_prepare_common to determine whether to compress
> dirty pages, but multifd_send_prepare_common does not update
> the IOV of MultiFDPacket_t when all dirty pages are zero pages.
> 
> The solution is to always update the IOV of MultiFDPacket_t
> regardless of whether the dirty pages are all zero pages.
> 
> Signed-off-by: Yuan Liu <yuan1.liu@intel.com>
> Reviewed-by: Jason Zeng <jason.zeng@intel.com>

Ouch.. thanks for digging this out.

Reviewed-by: Peter Xu <peterx@redhat.com>

Is this the correct Fixes tag (and copy stable for 9.0+)?

Fixes: 303e6f54f9 ("migration/multifd: Implement zero page transmission on the multifd thread.")

> ---
>  migration/multifd-nocomp.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/migration/multifd-nocomp.c b/migration/multifd-nocomp.c
> index 55191152f9..2e4aaac285 100644
> --- a/migration/multifd-nocomp.c
> +++ b/migration/multifd-nocomp.c
> @@ -362,6 +362,7 @@ int multifd_ram_flush_and_sync(void)
>  bool multifd_send_prepare_common(MultiFDSendParams *p)
>  {
>      MultiFDPages_t *pages = &p->data->u.ram;
> +    multifd_send_prepare_header(p);
>      multifd_send_zero_page_detect(p);
>  
>      if (!pages->normal_num) {
> @@ -369,8 +370,6 @@ bool multifd_send_prepare_common(MultiFDSendParams *p)
>          return false;
>      }
>  
> -    multifd_send_prepare_header(p);
> -
>      return true;
>  }
>  
> -- 
> 2.43.0
> 

-- 
Peter Xu



  reply	other threads:[~2024-12-18 17:03 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-18  9:14 [PATCH 0/3] bugfixes for migration using compression methods Yuan Liu
2024-12-18  9:14 ` [PATCH 1/3] multifd: bugfix " Yuan Liu
2024-12-18 17:03   ` Peter Xu [this message]
2024-12-19  8:42     ` Liu, Yuan1
2024-12-18  9:14 ` [PATCH 2/3] multifd: bugfix for incorrect migration data with QPL compression Yuan Liu
2024-12-18 17:08   ` Peter Xu
2024-12-18  9:14 ` [PATCH 3/3] multifd: bugfix for incorrect migration data with qatzip compression Yuan Liu
2024-12-18 17:08   ` Peter Xu
2024-12-18 17:12 ` [PATCH 0/3] bugfixes for migration using compression methods Peter Xu
2025-01-12 13:12 ` Michael Tokarev
2025-01-13  0:58   ` Liu, Yuan1

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=Z2MAUj-ComKI2HUE@x1n \
    --to=peterx@redhat.com \
    --cc=farosas@suse.de \
    --cc=jason.zeng@intel.com \
    --cc=qemu-devel@nongnu.org \
    --cc=yichen.wang@bytedance.com \
    --cc=yuan1.liu@intel.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.