From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:45862) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sm0fh-0006h6-Oz for qemu-devel@nongnu.org; Tue, 03 Jul 2012 06:49:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Sm0fg-0006YZ-3q for qemu-devel@nongnu.org; Tue, 03 Jul 2012 06:49:29 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56191) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sm0ff-0006YN-SN for qemu-devel@nongnu.org; Tue, 03 Jul 2012 06:49:28 -0400 From: Juan Quintela In-Reply-To: <4FF03FC5.4090804@gmail.com> (Igor Mitsyanko's message of "Sun, 01 Jul 2012 16:17:09 +0400") References: <4FF03FC5.4090804@gmail.com> Date: Tue, 03 Jul 2012 12:48:57 +0200 Message-ID: <87bojxunl2.fsf@elfo.mitica> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH 11/12] ram: iterate phase Reply-To: quintela@redhat.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Igor Mitsyanko Cc: owasserm@redhat.com, qemu-devel@nongnu.org Igor Mitsyanko wrote: > 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()? It "depends" only of the network speed, memory_global_sync_dirty_bitmap() should be really fast (notice that with lots of memory this couldn't be true). Later, Juan.