From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44576) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZuP2L-00018p-5a for qemu-devel@nongnu.org; Thu, 05 Nov 2015 13:13:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZuP2K-0004BI-6S for qemu-devel@nongnu.org; Thu, 05 Nov 2015 13:13:25 -0500 Received: from mx1.redhat.com ([209.132.183.28]:57852) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZuP2K-0004BD-15 for qemu-devel@nongnu.org; Thu, 05 Nov 2015 13:13:24 -0500 From: "Dr. David Alan Gilbert (git)" Date: Thu, 5 Nov 2015 18:11:13 +0000 Message-Id: <1446747083-18205-47-git-send-email-dgilbert@redhat.com> In-Reply-To: <1446747083-18205-1-git-send-email-dgilbert@redhat.com> References: <1446747083-18205-1-git-send-email-dgilbert@redhat.com> Subject: [Qemu-devel] [PATCH v9 46/56] 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, liang.z.li@intel.com, luis@cs.umu.se, bharata@linux.vnet.ibm.com, amit.shah@redhat.com, pbonzini@redhat.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 Reviewed-by: David Gibson Reviewed-by: Juan Quintela Reviewed-by: Amit Shah --- migration/ram.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/migration/ram.c b/migration/ram.c index 8bf0841..339b001 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -1846,7 +1846,9 @@ static int ram_save_complete(QEMUFile *f, void *opaque) { rcu_read_lock(); - migration_bitmap_sync(); + if (!migration_in_postcopy(migrate_get_current())) { + migration_bitmap_sync(); + } ram_control_before_iterate(f, RAM_CONTROL_FINISH); @@ -1881,7 +1883,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_in_postcopy(migrate_get_current()) && + remaining_size < max_size) { qemu_mutex_lock_iothread(); rcu_read_lock(); migration_bitmap_sync(); -- 2.5.0