[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] migration: just pass RAMBlock is enough
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH] migration: just pass RAMBlock is enough |
Date: |
Thu, 18 Jul 2019 10:17:19 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 |
On 18/07/19 03:25, Wei Yang wrote:
> RAMBlock->used_length is always passed to migration_bitmap_sync_range(),
> which could be retrieved from RAMBlock.
>
> Suggested-by: Paolo Bonzini <address@hidden>
> Signed-off-by: Wei Yang <address@hidden>
> ---
> migration/ram.c | 9 ++++-----
> 1 file changed, 4 insertions(+), 5 deletions(-)
>
> diff --git a/migration/ram.c b/migration/ram.c
> index 908517fc2b..0a6070d787 100644
> --- a/migration/ram.c
> +++ b/migration/ram.c
> @@ -1669,11 +1669,10 @@ static inline bool
> migration_bitmap_clear_dirty(RAMState *rs,
> return ret;
> }
>
> -static void migration_bitmap_sync_range(RAMState *rs, RAMBlock *rb,
> - ram_addr_t length)
> +static void migration_bitmap_sync_range(RAMState *rs, RAMBlock *rb)
> {
> rs->migration_dirty_pages +=
> - cpu_physical_memory_sync_dirty_bitmap(rb, 0, length,
> + cpu_physical_memory_sync_dirty_bitmap(rb, 0, rb->used_length,
> &rs->num_dirty_pages_period);
> }
>
> @@ -1762,7 +1761,7 @@ static void migration_bitmap_sync(RAMState *rs)
> qemu_mutex_lock(&rs->bitmap_mutex);
> rcu_read_lock();
> RAMBLOCK_FOREACH_NOT_IGNORED(block) {
> - migration_bitmap_sync_range(rs, block, block->used_length);
> + migration_bitmap_sync_range(rs, block);
> }
> ram_counters.remaining = ram_bytes_remaining();
> rcu_read_unlock();
> @@ -4193,7 +4192,7 @@ static void colo_flush_ram_cache(void)
> memory_global_dirty_log_sync();
> rcu_read_lock();
> RAMBLOCK_FOREACH_NOT_IGNORED(block) {
> - migration_bitmap_sync_range(ram_state, block, block->used_length);
> + migration_bitmap_sync_range(ram_state, block);
> }
> rcu_read_unlock();
>
>
Reviewed-by: Paolo Bonzini <address@hidden>
and in fact we can rename the function to ramblock_sync_dirty_bitmap.
Paolo