From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:55949) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UK4G4-0005Ch-3s for qemu-devel@nongnu.org; Mon, 25 Mar 2013 06:04:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UK4G2-0002f9-04 for qemu-devel@nongnu.org; Mon, 25 Mar 2013 06:04:04 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55100) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UK4G1-0002f4-OJ for qemu-devel@nongnu.org; Mon, 25 Mar 2013 06:04:01 -0400 Message-ID: <51502154.5060005@redhat.com> Date: Mon, 25 Mar 2013 12:05:08 +0200 From: Orit Wasserman MIME-Version: 1.0 References: <1363956370-23681-1-git-send-email-pl@kamp.de> <1363956370-23681-9-git-send-email-pl@kamp.de> In-Reply-To: <1363956370-23681-9-git-send-email-pl@kamp.de> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCHv4 8/9] migration: do not search dirty pages in bulk stage List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Lieven Cc: Stefan Hajnoczi , Paolo Bonzini , qemu-devel@nongnu.org, quintela@redhat.com On 03/22/2013 02:46 PM, Peter Lieven wrote: > avoid searching for dirty pages just increment the > page offset. all pages are dirty anyway. > > Signed-off-by: Peter Lieven > Reviewed-by: Eric Blake > --- > arch_init.c | 8 +++++++- > 1 file changed, 7 insertions(+), 1 deletion(-) > > diff --git a/arch_init.c b/arch_init.c > index c34a4af..b2b932a 100644 > --- a/arch_init.c > +++ b/arch_init.c > @@ -338,7 +338,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); > Reviewed-by: Orit Wasserman