[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 22/27] postcopy: Send whole huge pages
From: |
Dr. David Alan Gilbert (git) |
Subject: |
[Qemu-devel] [PULL 22/27] postcopy: Send whole huge pages |
Date: |
Tue, 28 Feb 2017 12:40:51 +0000 |
From: "Dr. David Alan Gilbert" <address@hidden>
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 <address@hidden>
Reviewed-by: Juan Quintela <address@hidden>
Reviewed-by: Laurent Vivier <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Dr. David Alan Gilbert <address@hidden>
---
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
- [Qemu-devel] [PULL 11/27] migration: fix use-after-free of to_dst_file, (continued)
- [Qemu-devel] [PULL 11/27] migration: fix use-after-free of to_dst_file, Dr. David Alan Gilbert (git), 2017/02/28
- [Qemu-devel] [PULL 13/27] postcopy: Transmit and compare individual page sizes, Dr. David Alan Gilbert (git), 2017/02/28
- [Qemu-devel] [PULL 14/27] postcopy: Chunk discards for hugepages, Dr. David Alan Gilbert (git), 2017/02/28
- [Qemu-devel] [PULL 16/27] postcopy: enhance ram_block_discard_range for hugepages, Dr. David Alan Gilbert (git), 2017/02/28
- [Qemu-devel] [PULL 17/27] postcopy: Record largest page size, Dr. David Alan Gilbert (git), 2017/02/28
- [Qemu-devel] [PULL 15/27] exec: ram_block_discard_range, Dr. David Alan Gilbert (git), 2017/02/28
- [Qemu-devel] [PULL 18/27] postcopy: Plumb pagesize down into place helpers, Dr. David Alan Gilbert (git), 2017/02/28
- [Qemu-devel] [PULL 19/27] postcopy: Use temporary for placing zero huge pages, Dr. David Alan Gilbert (git), 2017/02/28
- [Qemu-devel] [PULL 20/27] postcopy: Load huge pages in one go, Dr. David Alan Gilbert (git), 2017/02/28
- [Qemu-devel] [PULL 21/27] postcopy: Mask fault addresses to huge page boundary, Dr. David Alan Gilbert (git), 2017/02/28
- [Qemu-devel] [PULL 22/27] postcopy: Send whole huge pages,
Dr. David Alan Gilbert (git) <=
- [Qemu-devel] [PULL 23/27] postcopy: Allow hugepages, Dr. David Alan Gilbert (git), 2017/02/28
- [Qemu-devel] [PULL 24/27] postcopy: Update userfaultfd.h header, Dr. David Alan Gilbert (git), 2017/02/28
- [Qemu-devel] [PULL 25/27] postcopy: Check for userfault+hugepage feature, Dr. David Alan Gilbert (git), 2017/02/28
- [Qemu-devel] [PULL 26/27] postcopy: Add doc about hugepages and postcopy, Dr. David Alan Gilbert (git), 2017/02/28
- [Qemu-devel] [PULL 27/27] postcopy: Add extra check for COPY function, Dr. David Alan Gilbert (git), 2017/02/28