qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Xu <peterx@redhat.com>
To: Hao Xiang <hao.xiang@bytedance.com>
Cc: qemu-devel@nongnu.org, farosas@suse.de
Subject: Re: [PATCH 4/6] migration/multifd: Zero page transmission on the multifd thread.
Date: Wed, 7 Feb 2024 12:45:58 +0800	[thread overview]
Message-ID: <ZcMLBlQDiL-avbNy@x1n> (raw)
In-Reply-To: <20240206231908.1792529-5-hao.xiang@bytedance.com>

On Tue, Feb 06, 2024 at 11:19:06PM +0000, Hao Xiang wrote:
> This implements the zero page detection and handling on the multifd
> threads.
> 
> Signed-off-by: Hao Xiang <hao.xiang@bytedance.com>
> ---
>  migration/multifd.c | 62 +++++++++++++++++++++++++++++++++++++++++----
>  migration/multifd.h |  5 ++++
>  2 files changed, 62 insertions(+), 5 deletions(-)
> 
> diff --git a/migration/multifd.c b/migration/multifd.c
> index a20d0ed10e..c031f947c7 100644
> --- a/migration/multifd.c
> +++ b/migration/multifd.c
> @@ -11,6 +11,7 @@
>   */
>  
>  #include "qemu/osdep.h"
> +#include "qemu/cutils.h"
>  #include "qemu/rcu.h"
>  #include "exec/target_page.h"
>  #include "sysemu/sysemu.h"
> @@ -278,6 +279,12 @@ static void multifd_send_fill_packet(MultiFDSendParams *p)
>  
>          packet->offset[i] = cpu_to_be64(temp);
>      }
> +    for (i = 0; i < p->zero_num; i++) {
> +        /* there are architectures where ram_addr_t is 32 bit */
> +        uint64_t temp = p->zero[i];
> +
> +        packet->offset[p->normal_num + i] = cpu_to_be64(temp);
> +    }
>  }

Please be noted taht p->normal_num will be dropped very soon, see:

https://lore.kernel.org/all/20240202102857.110210-6-peterx@redhat.com/

Please use p->pages->num instead.

This patch also relies on some changes in previous patch.. IMHO we can
split the patch better in this way:

  - Patch 1: Add new parameter "zero-page-detection", support "none",
    "legacy".  You'll need to implement "none" here that we skip zero page
    by returning 0 in save_zero_page() if "none".

  - Patch 2: Add new "multifd" mode in above, implement it in the same
    patch completely.

  - Patch 3: introduce ram_save_target_page_multifd()

  - Patch 4: test case

If you want to add "zeros" accounting, that can be done as more patches on
top.

Thanks,

-- 
Peter Xu



  reply	other threads:[~2024-02-07  4:46 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-06 23:19 [PATCH 0/6] Introduce multifd zero page checking Hao Xiang
2024-02-06 23:19 ` [PATCH 1/6] migration/multifd: Add new migration option multifd-zero-page Hao Xiang
2024-02-07  3:44   ` Peter Xu
2024-02-08  0:49     ` [External] " Hao Xiang
2024-02-06 23:19 ` [PATCH 2/6] migration/multifd: Add zero pages and zero bytes counter to migration status interface Hao Xiang
2024-02-07  4:13   ` Peter Xu
2024-02-07  4:37     ` Peter Xu
2024-02-07  8:41       ` Jiri Denemark
2024-02-07 23:44         ` [External] " Hao Xiang
2024-02-08  2:51           ` Peter Xu
2024-02-06 23:19 ` [PATCH 3/6] migration/multifd: Support for zero pages transmission in multifd format Hao Xiang
2024-02-07  4:25   ` Peter Xu
2024-02-08 19:03     ` [External] " Hao Xiang
2024-02-06 23:19 ` [PATCH 4/6] migration/multifd: Zero page transmission on the multifd thread Hao Xiang
2024-02-07  4:45   ` Peter Xu [this message]
2024-02-06 23:19 ` [PATCH 5/6] migration/multifd: Enable zero page checking from multifd threads Hao Xiang
2024-02-06 23:19 ` [PATCH 6/6] migration/multifd: Add a new migration test case for legacy zero page checking Hao Xiang
2024-02-07  3:39 ` [PATCH 0/6] Introduce multifd " Peter Xu
2024-02-08  0:47   ` [External] " Hao Xiang
2024-02-08  2:36     ` Peter Xu

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=ZcMLBlQDiL-avbNy@x1n \
    --to=peterx@redhat.com \
    --cc=farosas@suse.de \
    --cc=hao.xiang@bytedance.com \
    --cc=qemu-devel@nongnu.org \
    /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).