qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH V2] add migration capability to bypass the share


From: Li, Liang Z
Subject: Re: [Qemu-devel] [PATCH V2] add migration capability to bypass the shared memory
Date: Wed, 10 Aug 2016 02:22:28 +0000

Hi Jiangshan,

Glad to see your patch. It's a simple implementation which could provide very 
useful functions.

> +static void migration_bitmap_init(unsigned long *bitmap) {
> +    RAMBlock *block;
> +
> +    bitmap_clear(bitmap, 0, last_ram_offset() >> TARGET_PAGE_BITS);
> +    rcu_read_lock();
> +    QLIST_FOREACH_RCU(block, &ram_list.blocks, next) {
> +        if (!migrate_bypass_shared_memory()
> || !qemu_ram_is_shared(block)) {
> +            bitmap_set(bitmap, block->offset >> TARGET_PAGE_BITS,

You should use (block->offset >> TARGET_PAGE_BITS )/ BITS_PER_LONG here.

> +                       block->used_length >> TARGET_PAGE_BITS);
> +
> +            /*
> +             * Count the total number of pages used by ram blocks not 
> including
> +             * any gaps due to alignment or unplugs.
> +             */
> +            migration_dirty_pages += block->used_length >>
> TARGET_PAGE_BITS;
> +        }
> +    }
> +    rcu_read_unlock();
>  }

Liang

reply via email to

[Prev in Thread] Current Thread [Next in Thread]