qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Dr. David Alan Gilbert (git)" <dgilbert@redhat.com>
To: qemu-devel@nongnu.org, quintela@redhat.com, lvivier@redhat.com
Cc: aarcange@redhat.com
Subject: [Qemu-devel] [PATCH v3 11/16] postcopy: Send whole huge pages
Date: Fri, 24 Feb 2017 18:28:39 +0000	[thread overview]
Message-ID: <20170224182844.32452-12-dgilbert@redhat.com> (raw)
In-Reply-To: <20170224182844.32452-1-dgilbert@redhat.com>

From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>

The RAM save code uses ram_save_host_page to send whole
host pages at a time;  change this to use the host page size associated
with the RAM Block which may be a huge page.

Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Laurent Vivier <lvivier@redhat.com>
---
 migration/ram.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/migration/ram.c b/migration/ram.c
index 9f28da2..719425b 100644
--- a/migration/ram.c
+++ b/migration/ram.c
@@ -1302,6 +1302,8 @@ static int ram_save_target_page(MigrationState *ms, QEMUFile *f,
  *                     offset to point into the middle of a host page
  *                     in which case the remainder of the hostpage is sent.
  *                     Only dirty target pages are sent.
+ *                     Note that the host page size may be a huge page for this
+ *                     block.
  *
  * Returns: Number of pages written.
  *
@@ -1320,6 +1322,8 @@ static int ram_save_host_page(MigrationState *ms, QEMUFile *f,
                               ram_addr_t dirty_ram_abs)
 {
     int tmppages, pages = 0;
+    size_t pagesize = qemu_ram_pagesize(pss->block);
+
     do {
         tmppages = ram_save_target_page(ms, f, pss, last_stage,
                                         bytes_transferred, dirty_ram_abs);
@@ -1330,7 +1334,7 @@ static int ram_save_host_page(MigrationState *ms, QEMUFile *f,
         pages += tmppages;
         pss->offset += TARGET_PAGE_SIZE;
         dirty_ram_abs += TARGET_PAGE_SIZE;
-    } while (pss->offset & (qemu_host_page_size - 1));
+    } while (pss->offset & (pagesize - 1));
 
     /* The offset we leave with is the last one we looked at */
     pss->offset -= TARGET_PAGE_SIZE;
-- 
2.9.3

  parent reply	other threads:[~2017-02-24 18:29 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-24 18:28 [Qemu-devel] [PATCH v3 00/16] Postcopy: Hugepage support Dr. David Alan Gilbert (git)
2017-02-24 18:28 ` [Qemu-devel] [PATCH v3 01/16] postcopy: Transmit ram size summary word Dr. David Alan Gilbert (git)
2017-02-24 18:28 ` [Qemu-devel] [PATCH v3 02/16] postcopy: Transmit and compare individual page sizes Dr. David Alan Gilbert (git)
2017-02-24 18:28 ` [Qemu-devel] [PATCH v3 03/16] postcopy: Chunk discards for hugepages Dr. David Alan Gilbert (git)
2017-02-24 18:28 ` [Qemu-devel] [PATCH v3 04/16] exec: ram_block_discard_range Dr. David Alan Gilbert (git)
2017-02-26 19:23   ` Laurent Vivier
2017-02-24 18:28 ` [Qemu-devel] [PATCH v3 05/16] postcopy: enhance ram_block_discard_range for hugepages Dr. David Alan Gilbert (git)
2017-02-24 18:28 ` [Qemu-devel] [PATCH v3 06/16] postcopy: Record largest page size Dr. David Alan Gilbert (git)
2017-02-24 18:28 ` [Qemu-devel] [PATCH v3 07/16] postcopy: Plumb pagesize down into place helpers Dr. David Alan Gilbert (git)
2017-02-24 18:28 ` [Qemu-devel] [PATCH v3 08/16] postcopy: Use temporary for placing zero huge pages Dr. David Alan Gilbert (git)
2017-02-24 18:28 ` [Qemu-devel] [PATCH v3 09/16] postcopy: Load huge pages in one go Dr. David Alan Gilbert (git)
2017-02-24 18:28 ` [Qemu-devel] [PATCH v3 10/16] postcopy: Mask fault addresses to huge page boundary Dr. David Alan Gilbert (git)
2017-02-24 18:28 ` Dr. David Alan Gilbert (git) [this message]
2017-02-24 18:28 ` [Qemu-devel] [PATCH v3 12/16] postcopy: Allow hugepages Dr. David Alan Gilbert (git)
2017-02-24 18:28 ` [Qemu-devel] [PATCH v3 13/16] postcopy: Update userfaultfd.h header Dr. David Alan Gilbert (git)
2017-02-24 18:28 ` [Qemu-devel] [PATCH v3 14/16] postcopy: Check for userfault+hugepage feature Dr. David Alan Gilbert (git)
2017-02-24 18:28 ` [Qemu-devel] [PATCH v3 15/16] postcopy: Add doc about hugepages and postcopy Dr. David Alan Gilbert (git)
2017-02-24 18:28 ` [Qemu-devel] [PATCH v3 16/16] postcopy: Add extra check for COPY function Dr. David Alan Gilbert (git)
2017-02-26 19:16   ` Laurent Vivier

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=20170224182844.32452-12-dgilbert@redhat.com \
    --to=dgilbert@redhat.com \
    --cc=aarcange@redhat.com \
    --cc=lvivier@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.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).