From patchwork Tue Mar 12 15:55:02 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Lieven X-Patchwork-Id: 227064 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 3EA8F2C0291 for ; Wed, 13 Mar 2013 02:55:30 +1100 (EST) Received: from localhost ([::1]:60371 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UFRY0-0001ii-Gk for incoming@patchwork.ozlabs.org; Tue, 12 Mar 2013 11:55:28 -0400 Received: from eggs.gnu.org ([208.118.235.92]:58595) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UFRXh-0001TH-20 for qemu-devel@nongnu.org; Tue, 12 Mar 2013 11:55:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UFRXY-0004AI-W2 for qemu-devel@nongnu.org; Tue, 12 Mar 2013 11:55:07 -0400 Received: from ssl.dlhnet.de ([91.198.192.8]:46077 helo=ssl.dlh.net) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UFRXY-0004AB-P6 for qemu-devel@nongnu.org; Tue, 12 Mar 2013 11:55:00 -0400 Received: from localhost (localhost [127.0.0.1]) by ssl.dlh.net (Postfix) with ESMTP id 4642A14540E; Tue, 12 Mar 2013 16:55:00 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at ssl.dlh.net Received: from ssl.dlh.net ([127.0.0.1]) by localhost (ssl.dlh.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id xhIczfanl9rL; Tue, 12 Mar 2013 16:55:00 +0100 (CET) Received: from [172.21.12.60] (unknown [82.141.1.226]) by ssl.dlh.net (Postfix) with ESMTPSA id F234A13F711; Tue, 12 Mar 2013 16:54:59 +0100 (CET) Message-ID: <513F4FD6.2060609@dlhnet.de> Date: Tue, 12 Mar 2013 16:55:02 +0100 From: Peter Lieven User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130221 Thunderbird/17.0.3 MIME-Version: 1.0 To: "qemu-devel@nongnu.org" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 91.198.192.8 Cc: Kevin Wolf , Paolo Bonzini , Orit Wasserman , Stefan Hajnoczi Subject: [Qemu-devel] [RFC][PATCH 9/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 | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/arch_init.c b/arch_init.c index abd54a7..45fcf4d 100644 --- a/arch_init.c +++ b/arch_init.c @@ -336,8 +336,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--;