All of lore.kernel.org
 help / color / mirror / Atom feed
From: Juan Quintela <quintela@redhat.com>
To: Quan Xu <quan.xu0@gmail.com>
Cc: qemu-devel@nongnu.org, kvm <kvm@vger.kernel.org>, dgilbert@redhat.com
Subject: Re: [PATCH RFC] migration: make sure to run iterate precopy during the bulk stage
Date: Tue, 04 Sep 2018 11:12:18 +0200	[thread overview]
Message-ID: <87va7lvd71.fsf@trasno.org> (raw)
In-Reply-To: <5ab76c3e-9310-0e08-2f1b-4ff52bf229f8@gmail.com> (Quan Xu's message of "Wed, 29 Aug 2018 21:40:50 +0800")

Quan Xu <quan.xu0@gmail.com> wrote:
> From 8dbf7370e7ea1caab0b769d0d4dcdd072d14d421 Mon Sep 17 00:00:00 2001
> From: Quan Xu <quan.xu0@gmail.com>
> Date: Wed, 29 Aug 2018 21:33:14 +0800
> Subject: [PATCH RFC] migration: make sure to run iterate precopy during the
>  bulk stage
>
> Since the bulk stage assumes in (migration_bitmap_find_dirty) that every
> page is dirty, return a rough total ram as pending size to make sure that
> migration thread continues to run iterate precopy during the bulk stage.
>
> Otherwise the downtime grows unpredictably, as migration thread needs to
> send both the rest of pages and dirty pages during complete precopy.
>
> Signed-off-by: Quan Xu <quan.xu0@gmail.com>
> ---
>  migration/ram.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/migration/ram.c b/migration/ram.c
> index 79c8942..cfa304c 100644
> --- a/migration/ram.c
> +++ b/migration/ram.c
> @@ -3308,7 +3308,8 @@ static void ram_save_pending(QEMUFile *f, void
> *opaque, uint64_t max_size,
>          /* We can do postcopy, and all the data is postcopiable */
>          *res_compatible += remaining_size;
>      } else {
> -        *res_precopy_only += remaining_size;
> +        *res_precopy_only += (rs->ram_bulk_stage ?
> +                              ram_bytes_total() : remaining_size);
>      }
>  }

Hi

I don't oppose the change.
But what I don't understand is _why_ it is needed (or to say it
otherwise, how it worked until now).   I was wondering about the opposit
direction, and just initialize the number of dirty pages at the
beggining of the loop and then let decrease it for each processed page.

I don't remember either how big was the speedud of not walking the
bitmap on the 1st stage to start with.

Later, Juan.

WARNING: multiple messages have this Message-ID (diff)
From: Juan Quintela <quintela@redhat.com>
To: Quan Xu <quan.xu0@gmail.com>
Cc: qemu-devel@nongnu.org, dgilbert@redhat.com, kvm <kvm@vger.kernel.org>
Subject: Re: [Qemu-devel] [PATCH RFC] migration: make sure to run iterate precopy during the bulk stage
Date: Tue, 04 Sep 2018 11:12:18 +0200	[thread overview]
Message-ID: <87va7lvd71.fsf@trasno.org> (raw)
In-Reply-To: <5ab76c3e-9310-0e08-2f1b-4ff52bf229f8@gmail.com> (Quan Xu's message of "Wed, 29 Aug 2018 21:40:50 +0800")

Quan Xu <quan.xu0@gmail.com> wrote:
> From 8dbf7370e7ea1caab0b769d0d4dcdd072d14d421 Mon Sep 17 00:00:00 2001
> From: Quan Xu <quan.xu0@gmail.com>
> Date: Wed, 29 Aug 2018 21:33:14 +0800
> Subject: [PATCH RFC] migration: make sure to run iterate precopy during the
>  bulk stage
>
> Since the bulk stage assumes in (migration_bitmap_find_dirty) that every
> page is dirty, return a rough total ram as pending size to make sure that
> migration thread continues to run iterate precopy during the bulk stage.
>
> Otherwise the downtime grows unpredictably, as migration thread needs to
> send both the rest of pages and dirty pages during complete precopy.
>
> Signed-off-by: Quan Xu <quan.xu0@gmail.com>
> ---
>  migration/ram.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/migration/ram.c b/migration/ram.c
> index 79c8942..cfa304c 100644
> --- a/migration/ram.c
> +++ b/migration/ram.c
> @@ -3308,7 +3308,8 @@ static void ram_save_pending(QEMUFile *f, void
> *opaque, uint64_t max_size,
>          /* We can do postcopy, and all the data is postcopiable */
>          *res_compatible += remaining_size;
>      } else {
> -        *res_precopy_only += remaining_size;
> +        *res_precopy_only += (rs->ram_bulk_stage ?
> +                              ram_bytes_total() : remaining_size);
>      }
>  }

Hi

I don't oppose the change.
But what I don't understand is _why_ it is needed (or to say it
otherwise, how it worked until now).   I was wondering about the opposit
direction, and just initialize the number of dirty pages at the
beggining of the loop and then let decrease it for each processed page.

I don't remember either how big was the speedud of not walking the
bitmap on the 1st stage to start with.

Later, Juan.

  parent reply	other threads:[~2018-09-04  9:12 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-29 13:40 [PATCH RFC] migration: make sure to run iterate precopy during the bulk stage Quan Xu
2018-08-29 13:40 ` [Qemu-devel] " Quan Xu
2018-09-04  9:09 ` Dr. David Alan Gilbert
2018-09-04  9:09   ` [Qemu-devel] " Dr. David Alan Gilbert
2018-09-04 13:34   ` Quan Xu
2018-09-04 13:34     ` [Qemu-devel] " Quan Xu
2018-09-04  9:12 ` Juan Quintela [this message]
2018-09-04  9:12   ` Juan Quintela
2018-09-04 12:48   ` Quan Xu
2018-09-04 12:48     ` [Qemu-devel] " Quan 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=87va7lvd71.fsf@trasno.org \
    --to=quintela@redhat.com \
    --cc=dgilbert@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=qemu-devel@nongnu.org \
    --cc=quan.xu0@gmail.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.