From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:35006) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SlJ5X-0007ai-RC for qemu-devel@nongnu.org; Sun, 01 Jul 2012 08:17:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SlJ5V-0002Jh-EA for qemu-devel@nongnu.org; Sun, 01 Jul 2012 08:17:15 -0400 Received: from mail-lb0-f173.google.com ([209.85.217.173]:54680) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SlJ5V-0002JH-3f for qemu-devel@nongnu.org; Sun, 01 Jul 2012 08:17:13 -0400 Received: by lbok6 with SMTP id k6so5747665lbo.4 for ; Sun, 01 Jul 2012 05:17:10 -0700 (PDT) Message-ID: <4FF03FC5.4090804@gmail.com> Date: Sun, 01 Jul 2012 16:17:09 +0400 From: Igor Mitsyanko MIME-Version: 1.0 References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 11/12] ram: iterate phase List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Juan Quintela Cc: owasserm@redhat.com, qemu-devel@nongnu.org On 6/28/2012 11:22 PM, Juan Quintela wrote: > We only need to synchronize the bitmap when the number of dirty pages is low. > Not every time that we call the function. > > Signed-off-by: Juan Quintela > --- > arch_init.c | 9 ++++++--- > 1 file changed, 6 insertions(+), 3 deletions(-) > > diff --git a/arch_init.c b/arch_init.c > index fe843a7..8299c15 100644 > --- a/arch_init.c > +++ b/arch_init.c > @@ -348,8 +348,6 @@ static int ram_save_iterate(QEMUFile *f, void *opaque) > int i; > uint64_t expected_time; > > - memory_global_sync_dirty_bitmap(get_system_memory()); > - > bytes_transferred_last = bytes_transferred; > bwidth = qemu_get_clock_ns(rt_clock); > > @@ -397,7 +395,12 @@ static int ram_save_iterate(QEMUFile *f, void *opaque) > DPRINTF("ram_save_live: expected(%ld) <= max(%ld)?\n", expected_time, > migrate_max_downtime()); > > - return expected_time <= migrate_max_downtime(); > + if (expected_time <= migrate_max_downtime()) { > + memory_global_sync_dirty_bitmap(get_system_memory()); > + > + return expected_time <= migrate_max_downtime(); Shouldn't expected_time be recalculated after memory_global_sync_dirty_bitmap()? > + } > + return 0; > } > > static int ram_save_complete(QEMUFile *f, void *opaque) >