From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42371) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZF01d-0007Oe-EP for qemu-devel@nongnu.org; Tue, 14 Jul 2015 09:13:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZF01X-0001y3-95 for qemu-devel@nongnu.org; Tue, 14 Jul 2015 09:13:33 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34808) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZF01X-0001xr-3V for qemu-devel@nongnu.org; Tue, 14 Jul 2015 09:13:27 -0400 Date: Tue, 14 Jul 2015 14:13:19 +0100 From: "Dr. David Alan Gilbert" Message-ID: <20150714131318.GG2336@work-vm> References: <1434450415-11339-1-git-send-email-dgilbert@redhat.com> <1434450415-11339-36-git-send-email-dgilbert@redhat.com> <87twt6gbkt.fsf@neno.neno> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87twt6gbkt.fsf@neno.neno> Subject: Re: [Qemu-devel] [PATCH v7 35/42] Don't sync dirty bitmaps in postcopy List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Juan Quintela Cc: aarcange@redhat.com, yamahata@private.email.ne.jp, liang.z.li@intel.com, "Dr. David Alan Gilbert (git)" , qemu-devel@nongnu.org, luis@cs.umu.se, amit.shah@redhat.com, pbonzini@redhat.com, david@gibson.dropbear.id.au * Juan Quintela (quintela@redhat.com) wrote: > "Dr. David Alan Gilbert (git)" wrote: > > 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 > > But, in what patch do we sync the migratioon bitmap after changing to postcopy? It's called one last time in ram_postcopy_send_discard_bitmap; see: v7-0025-Postcopy-Maintain-sentmap-and-calculate-discard.patch and that happens at the start of postcopy mode, when the CPU is stopped and won't be running on the source again. Dave > > > --- > > migration/ram.c | 7 +++++-- > > 1 file changed, 5 insertions(+), 2 deletions(-) > > > > diff --git a/migration/ram.c b/migration/ram.c > > index 01a0ab4..5cff4d6 100644 > > --- a/migration/ram.c > > +++ b/migration/ram.c > > @@ -1643,7 +1643,9 @@ static int ram_save_complete(QEMUFile *f, void *opaque) > > { > > rcu_read_lock(); > > > > - migration_bitmap_sync(); > > + if (!migration_postcopy_phase(migrate_get_current())) { > > + migration_bitmap_sync(); > > + } > > > > ram_control_before_iterate(f, RAM_CONTROL_FINISH); > > > > @@ -1678,7 +1680,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(); > > rcu_read_lock(); > > migration_bitmap_sync(); -- Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK