From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35025) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YQfDZ-0001q1-6d for qemu-devel@nongnu.org; Wed, 25 Feb 2015 11:53:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YQfDY-0001S7-9N for qemu-devel@nongnu.org; Wed, 25 Feb 2015 11:53:49 -0500 Received: from mx1.redhat.com ([209.132.183.28]:33488) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YQfDY-0001Rz-0U for qemu-devel@nongnu.org; Wed, 25 Feb 2015 11:53:48 -0500 From: "Dr. David Alan Gilbert (git)" Date: Wed, 25 Feb 2015 16:52:01 +0000 Message-Id: <1424883128-9841-39-git-send-email-dgilbert@redhat.com> In-Reply-To: <1424883128-9841-1-git-send-email-dgilbert@redhat.com> References: <1424883128-9841-1-git-send-email-dgilbert@redhat.com> Subject: [Qemu-devel] [PATCH v5 38/45] Don't sync dirty bitmaps in postcopy List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: aarcange@redhat.com, yamahata@private.email.ne.jp, quintela@redhat.com, amit.shah@redhat.com, pbonzini@redhat.com, yanghy@cn.fujitsu.com, david@gibson.dropbear.id.au From: "Dr. David Alan Gilbert" Once we're in postcopy the source processors are stopped and memory shouldn't change any more, so there's no need to look at the dirty map. There are two notes to this: 1) If we do resync and a page had changed then the page would get sent again, which the destination wouldn't allow (since it might have also modified the page) 2) Before disabling this I'd seen very rare cases where a page had been marked dirtied although the memory contents are apparently identical Signed-off-by: Dr. David Alan Gilbert --- arch_init.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/arch_init.c b/arch_init.c index 7a1c9ea..9d8ca95 100644 --- a/arch_init.c +++ b/arch_init.c @@ -1398,7 +1398,10 @@ static int ram_save_iterate(QEMUFile *f, void *opaque) static int ram_save_complete(QEMUFile *f, void *opaque) { qemu_mutex_lock_ramlist(); - migration_bitmap_sync(); + + if (!migration_postcopy_phase(migrate_get_current())) { + migration_bitmap_sync(); + } ram_control_before_iterate(f, RAM_CONTROL_FINISH); @@ -1433,7 +1436,8 @@ static void ram_save_pending(QEMUFile *f, void *opaque, uint64_t max_size, remaining_size = ram_save_remaining() * TARGET_PAGE_SIZE; - if (remaining_size < max_size) { + if (!migration_postcopy_phase(migrate_get_current()) && + remaining_size < max_size) { qemu_mutex_lock_iothread(); migration_bitmap_sync(); qemu_mutex_unlock_iothread(); -- 2.1.0