From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
To: Wei Yang <richardw.yang@linux.intel.com>
Cc: pbonzini@redhat.com, qemu-devel@nongnu.org, quintela@redhat.com
Subject: Re: [PATCH 1/3] migration/postcopy: not necessary to do discard when canonicalizing bitmap
Date: Tue, 24 Sep 2019 11:02:08 +0100 [thread overview]
Message-ID: <20190924100208.GA2725@work-vm> (raw)
In-Reply-To: <20190819061843.28642-2-richardw.yang@linux.intel.com>
* Wei Yang (richardw.yang@linux.intel.com) wrote:
> All pages, either partially sent or partially dirty, will be discarded in
> postcopy_send_discard_bm_ram(), since we update the unsentmap to be
> unsentmap = unsentmap | dirty in ram_postcopy_send_discard_bitmap().
>
> This is not necessary to do discard when canonicalizing bitmap. And by
> doing so, we separate the page discard into two individual steps:
>
> * canonicalize bitmap
> * discard page
>
> Signed-off-by: Wei Yang <richardw.yang@linux.intel.com>
Yes, I think when I originally wrote it, the set of pages that was
discarded was different; I think it was actually the set of
!unsent & dirty - i.e. only pages that had been sent and then redirtied;
it later got reworked to include unsent pages as well - so this lot can
be simplified.
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
> ---
> migration/ram.c | 14 +-------------
> 1 file changed, 1 insertion(+), 13 deletions(-)
>
> diff --git a/migration/ram.c b/migration/ram.c
> index 35552c090b..075ddc468c 100644
> --- a/migration/ram.c
> +++ b/migration/ram.c
> @@ -2928,7 +2928,7 @@ static int postcopy_each_ram_send_discard(MigrationState *ms)
> }
>
> /**
> - * postcopy_chunk_hostpages_pass: canocalize bitmap in hostpages
> + * postcopy_chunk_hostpages_pass: canonicalize bitmap in hostpages
> *
> * Helper for postcopy_chunk_hostpages; it's called twice to
> * canonicalize the two bitmaps, that are similar, but one is
> @@ -2991,18 +2991,6 @@ static void postcopy_chunk_hostpages_pass(MigrationState *ms, bool unsent_pass,
> host_ratio);
> run_start = QEMU_ALIGN_UP(run_start, host_ratio);
>
> - /* Tell the destination to discard this page */
> - if (unsent_pass || !test_bit(fixup_start_addr, unsentmap)) {
> - /* For the unsent_pass we:
> - * discard partially sent pages
> - * For the !unsent_pass (dirty) we:
> - * discard partially dirty pages that were sent
> - * (any partially sent pages were already discarded
> - * by the previous unsent_pass)
> - */
> - postcopy_discard_send_range(ms, fixup_start_addr, host_ratio);
> - }
> -
> /* Clean up the bitmap */
> for (page = fixup_start_addr;
> page < fixup_start_addr + host_ratio; page++) {
> --
> 2.17.1
>
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
next prev parent reply other threads:[~2019-09-24 10:04 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-19 6:18 [Qemu-devel] [PATCH 0/3] migration/postcopy: unsentmap is not necessary Wei Yang
2019-08-19 6:18 ` [Qemu-devel] [PATCH 1/3] migration/postcopy: not necessary to do discard when canonicalizing bitmap Wei Yang
2019-09-24 10:02 ` Dr. David Alan Gilbert [this message]
2019-09-25 0:25 ` Wei Yang
2019-08-19 6:18 ` [Qemu-devel] [PATCH 2/3] migration/postcopy: unsentmap is not necessary for postcopy Wei Yang
2019-09-24 10:18 ` Dr. David Alan Gilbert
2019-08-19 6:18 ` [Qemu-devel] [PATCH 3/3] migration: remove sent parameter in get_queued_page_not_dirty Wei Yang
2019-09-24 10:19 ` Dr. David Alan Gilbert
2019-09-16 6:06 ` [Qemu-devel] [PATCH 0/3] migration/postcopy: unsentmap is not necessary Wei Yang
2019-09-20 18:53 ` Dr. David Alan Gilbert
2019-09-23 5:56 ` Wei Yang
2019-09-25 9:52 ` [Qemu-devel] " 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=20190924100208.GA2725@work-vm \
--to=dgilbert@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.com \
--cc=richardw.yang@linux.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 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).