[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 01/16] postcopy: Transmit ram size summary wo
From: |
Laurent Vivier |
Subject: |
Re: [Qemu-devel] [PATCH v2 01/16] postcopy: Transmit ram size summary word |
Date: |
Fri, 24 Feb 2017 11:16:15 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 |
On 06/02/2017 18:32, Dr. David Alan Gilbert (git) wrote:
> From: "Dr. David Alan Gilbert" <address@hidden>
>
> Replace the host page-size in the 'advise' command by a pagesize
> summary bitmap; if the VM is just using normal RAM then
> this will be exactly the same as before, however if they're using
> huge pages they'll be different, and thus:
> a) Migration from/to old qemu's that don't understand huge pages
> will fail early.
> b) Migrations with different size RAMBlocks will also fail early.
>
> This catches it very early; earlier than the detailed per-block
> check in the next patch.
>
> Signed-off-by: Dr. David Alan Gilbert <address@hidden>
> ---
> include/migration/migration.h | 1 +
> migration/ram.c | 17 +++++++++++++++++
> migration/savevm.c | 32 +++++++++++++++++++++-----------
> 3 files changed, 39 insertions(+), 11 deletions(-)
>
> diff --git a/include/migration/migration.h b/include/migration/migration.h
> index af9135f..96c9d6e 100644
> --- a/include/migration/migration.h
> +++ b/include/migration/migration.h
> @@ -366,6 +366,7 @@ void global_state_store_running(void);
> void flush_page_queue(MigrationState *ms);
> int ram_save_queue_pages(MigrationState *ms, const char *rbname,
> ram_addr_t start, ram_addr_t len);
> +uint64_t ram_pagesize_summary(void);
>
> PostcopyState postcopy_state_get(void);
> /* Set the state and return the old state */
> diff --git a/migration/ram.c b/migration/ram.c
> index ef8fadf..b405e4a 100644
> --- a/migration/ram.c
> +++ b/migration/ram.c
> @@ -600,6 +600,23 @@ static void migration_bitmap_sync_init(void)
> iterations_prev = 0;
> }
>
> +/* Returns a summary bitmap of the page sizes of all RAMBlocks;
> + * for VMs with just normal pages this is equivalent to the
> + * host page size. If it's got some huge pages then it's the OR
> + * of all the different page sizes.
> + */
> +uint64_t ram_pagesize_summary(void)
> +{
> + RAMBlock *block;
> + uint64_t summary = 0;
> +
> + QLIST_FOREACH_RCU(block, &ram_list.blocks, next) {
> + summary |= block->page_size;
It should be cleaner to use "qemu_ram_pagesize(block)".
It's only cosmetic, so:
Reviewed-by: Laurent Vivier <address@hidden>
- [Qemu-devel] [PATCH v2 00/16] Postcopy: Hugepage support, Dr. David Alan Gilbert (git), 2017/02/06
- [Qemu-devel] [PATCH v2 03/16] postcopy: Chunk discards for hugepages, Dr. David Alan Gilbert (git), 2017/02/06
- [Qemu-devel] [PATCH v2 01/16] postcopy: Transmit ram size summary word, Dr. David Alan Gilbert (git), 2017/02/06
- [Qemu-devel] [PATCH v2 05/16] postcopy: enhance ram_block_discard_range for hugepages, Dr. David Alan Gilbert (git), 2017/02/06
- [Qemu-devel] [PATCH v2 06/16] Fold postcopy_ram_discard_range into ram_discard_range, Dr. David Alan Gilbert (git), 2017/02/06
- [Qemu-devel] [PATCH v2 04/16] exec: ram_block_discard_range, Dr. David Alan Gilbert (git), 2017/02/06