[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 12/16] postcopy: Send whole huge pages
From: |
Laurent Vivier |
Subject: |
Re: [Qemu-devel] [PATCH v2 12/16] postcopy: Send whole huge pages |
Date: |
Fri, 24 Feb 2017 17:06:19 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 |
On 06/02/2017 18:33, Dr. David Alan Gilbert (git) wrote:
> 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>
> ---
> migration/ram.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/migration/ram.c b/migration/ram.c
> index 88d9444..2350f71 100644
> --- a/migration/ram.c
> +++ b/migration/ram.c
> @@ -1281,6 +1281,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.
> *
> @@ -1299,6 +1301,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);
> @@ -1309,7 +1313,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;
>
Reviewed-by: Laurent Vivier <address@hidden>
- Re: [Qemu-devel] [PATCH v2 11/16] postcopy: Mask fault addresses to huge page boundary, (continued)
- [Qemu-devel] [PATCH v2 08/16] postcopy: Plumb pagesize down into place helpers, Dr. David Alan Gilbert (git), 2017/02/06
- [Qemu-devel] [PATCH v2 13/16] postcopy: Allow hugepages, Dr. David Alan Gilbert (git), 2017/02/06
- [Qemu-devel] [PATCH v2 14/16] postcopy: Update userfaultfd.h header, Dr. David Alan Gilbert (git), 2017/02/06
- [Qemu-devel] [PATCH v2 12/16] postcopy: Send whole huge pages, Dr. David Alan Gilbert (git), 2017/02/06
- Re: [Qemu-devel] [PATCH v2 12/16] postcopy: Send whole huge pages,
Laurent Vivier <=
- [Qemu-devel] [PATCH v2 16/16] postcopy: Add doc about hugepages and postcopy, Dr. David Alan Gilbert (git), 2017/02/06
- [Qemu-devel] [PATCH v2 10/16] postcopy: Load huge pages in one go, Dr. David Alan Gilbert (git), 2017/02/06
- [Qemu-devel] [PATCH v2 15/16] postcopy: Check for userfault+hugepage feature, Dr. David Alan Gilbert (git), 2017/02/06
- Re: [Qemu-devel] [PATCH v2 00/16] Postcopy: Hugepage support, Dr. David Alan Gilbert, 2017/02/06