From patchwork Fri Mar 15 15:50:17 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Lieven X-Patchwork-Id: 228149 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 89B922C00B7 for ; Sat, 16 Mar 2013 06:28:55 +1100 (EST) Received: from localhost ([::1]:59171 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UGaJB-00034N-FR for incoming@patchwork.ozlabs.org; Fri, 15 Mar 2013 15:28:53 -0400 Received: from eggs.gnu.org ([208.118.235.92]:58133) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UGXDm-0001ON-Gi for qemu-devel@nongnu.org; Fri, 15 Mar 2013 12:11:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UGXDj-0006HU-SL for qemu-devel@nongnu.org; Fri, 15 Mar 2013 12:11:06 -0400 Received: from [2a02:248:0:30:223:aeff:fefe:7f1c] (port=48338 helo=dns.kamp-intra.net) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UGXDj-0006H0-M9 for qemu-devel@nongnu.org; Fri, 15 Mar 2013 12:11:03 -0400 Received: from lieven-pc.kamp-intra.net (lieven-pc.kamp-intra.net [172.21.12.60]) by dns.kamp-intra.net (Postfix) with ESMTP id 9DF45206EF; Fri, 15 Mar 2013 16:51:53 +0100 (CET) Received: by lieven-pc.kamp-intra.net (Postfix, from userid 1000) id 8354C62EA2; Fri, 15 Mar 2013 16:51:53 +0100 (CET) From: Peter Lieven To: qemu-devel@nongnu.org Date: Fri, 15 Mar 2013 16:50:17 +0100 Message-Id: <1363362619-3190-9-git-send-email-pl@kamp.de> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1363362619-3190-1-git-send-email-pl@kamp.de> References: <1363362619-3190-1-git-send-email-pl@kamp.de> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2a02:248:0:30:223:aeff:fefe:7f1c X-Mailman-Approved-At: Fri, 15 Mar 2013 15:28:22 -0400 Cc: Peter Lieven Subject: [Qemu-devel] [PATCHv2 8/9] migration: do not search dirty pages in bulk stage X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org avoid searching for dirty pages just increment the page offset. all pages are dirty anyway. Signed-off-by: Peter Lieven --- arch_init.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/arch_init.c b/arch_init.c index a3dc20d..ca281ad 100644 --- a/arch_init.c +++ b/arch_init.c @@ -321,8 +321,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) { + next = nr + 1; + } else { + next = find_next_bit(migration_bitmap, size, nr); + } + if (next < size) { clear_bit(next, migration_bitmap); migration_dirty_pages--; @@ -523,7 +529,7 @@ static void reset_ram_globals(void) { last_seen_block = NULL; last_sent_block = NULL; - last_offset = 0; + last_offset = -1; last_version = ram_list.version; ram_bulk_stage = true; }