From: Peter Lieven Date: Tue, 26 Mar 2013 09:58:38 +0000 (+0100) Subject: migration: do not search dirty pages in bulk stage X-Git-Tag: v1.5.0-rc0~410^2~8 X-Git-Url: https://git.proxmox.com/?p=qemu.git;a=commitdiff_plain;h=70c8652bf3c1fea79b7b68864e86926715c49261 migration: do not search dirty pages in bulk stage avoid searching for dirty pages just increment the page offset. all pages are dirty anyway. Signed-off-by: Peter Lieven Reviewed-by: Eric Blake Reviewed-by: Orit Wasserman Signed-off-by: Juan Quintela --- diff --git a/arch_init.c b/arch_init.c index 3a0d02eaf..a522735dd 100644 --- a/arch_init.c +++ b/arch_init.c @@ -340,7 +340,13 @@ ram_addr_t migration_bitmap_find_and_reset_dirty(MemoryRegion *mr, unsigned long nr = base + (start >> TARGET_PAGE_BITS); unsigned long size = base + (int128_get64(mr->size) >> TARGET_PAGE_BITS); - unsigned long next = find_next_bit(migration_bitmap, size, nr); + unsigned long next; + + if (ram_bulk_stage && nr > base) { + next = nr + 1; + } else { + next = find_next_bit(migration_bitmap, size, nr); + } if (next < size) { clear_bit(next, migration_bitmap);