From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:38581) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UIhsU-0006ln-VH for qemu-devel@nongnu.org; Thu, 21 Mar 2013 11:58:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UIhsP-0002kA-Af for qemu-devel@nongnu.org; Thu, 21 Mar 2013 11:58:06 -0400 Received: from [2a02:248:0:30:223:aeff:fefe:7f1c] (port=33569 helo=dns.kamp-intra.net) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UIhsP-0002jK-5T for qemu-devel@nongnu.org; Thu, 21 Mar 2013 11:58:01 -0400 From: Peter Lieven Date: Thu, 21 Mar 2013 16:57:36 +0100 Message-Id: <1363881457-14814-9-git-send-email-pl@kamp.de> In-Reply-To: <1363881457-14814-1-git-send-email-pl@kamp.de> References: <1363881457-14814-1-git-send-email-pl@kamp.de> Subject: [Qemu-devel] [PATCHv3 8/9] migration: do not search dirty pages in bulk stage List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, pbonzini@redhat.com, Peter Lieven avoid searching for dirty pages just increment the page offset. all pages are dirty anyway. Signed-off-by: Peter Lieven --- arch_init.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/arch_init.c b/arch_init.c index c2cb40a..4718d39 100644 --- a/arch_init.c +++ b/arch_init.c @@ -327,8 +327,14 @@ 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); migration_dirty_pages--; -- 1.7.9.5