From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49626) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZLDXK-00008u-Iz for qemu-devel@nongnu.org; Fri, 31 Jul 2015 12:52:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZLDXD-0000um-UR for qemu-devel@nongnu.org; Fri, 31 Jul 2015 12:51:58 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42090) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZLDXD-0000uG-Mf for qemu-devel@nongnu.org; Fri, 31 Jul 2015 12:51:51 -0400 Date: Fri, 31 Jul 2015 17:51:44 +0100 From: "Dr. David Alan Gilbert" Message-ID: <20150731165144.GF2272@work-vm> References: <1434450415-11339-1-git-send-email-dgilbert@redhat.com> <1434450415-11339-26-git-send-email-dgilbert@redhat.com> <20150721113600.GJ10280@grmbl.mre> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150721113600.GJ10280@grmbl.mre> Subject: Re: [Qemu-devel] [PATCH v7 25/42] Postcopy: Maintain sentmap and calculate discard List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Amit Shah Cc: aarcange@redhat.com, yamahata@private.email.ne.jp, quintela@redhat.com, liang.z.li@intel.com, qemu-devel@nongnu.org, luis@cs.umu.se, pbonzini@redhat.com, david@gibson.dropbear.id.au * Amit Shah (amit.shah@redhat.com) wrote: > On (Tue) 16 Jun 2015 [11:26:38], Dr. David Alan Gilbert (git) wrote: > > From: "Dr. David Alan Gilbert" > > > > Where postcopy is preceeded by a period of precopy, the destination will > > have received pages that may have been dirtied on the source after the > > page was sent. The destination must throw these pages away before > > starting it's CPUs. > > > > Maintain a 'sentmap' of pages that have already been sent. > > Calculate list of sent & dirty pages > > Provide helpers on the destination side to discard these. > > > > Signed-off-by: Dr. David Alan Gilbert > > Reviewed-by: Amit Shah > > Some whitespace issues, and some sentences in comments don't have a > full-stop: > > > +/* > > + * Called by the bitmap code for each chunk to discard > > + * May send a discard message, may just leave it queued to > > + * be sent later > > + * 'start' and 'end' describe an inclusive range of pages in the > > + * migration bitmap in the RAM block passed to postcopy_discard_send_init > > + */ > > +void postcopy_discard_send_range(MigrationState *ms, PostcopyDiscardState *pds, > > + unsigned long start, unsigned long end); > > unaligned line; no full-stop in comment above (similar elsewhere, not > repeating that). Fixed. > > +/* > > + * Discard the contents of memory start..end inclusive. > > + * We can assume that if we've been called postcopy_ram_hosttest returned true > > + */ > > +int postcopy_ram_discard_range(MigrationIncomingState *mis, uint8_t *start, > > + uint8_t *end) > > +{ > > + trace_postcopy_ram_discard_range(start, end); > > + if (madvise(start, (end-start)+1, MADV_DONTNEED)) { > > whitespace around operators Fixed. > > +/* > > + * Called by the bitmap code for each chunk to discard > > + * May send a discard message, may just leave it queued to > > + * be sent later > > + * 'start' and 'end' describe an inclusive range of pages in the > > + * migration bitmap in the RAM block passed to postcopy_discard_send_init > > missing punctuation > > (also, you had started doing doxygen-style comments, want to keep on > following that style?) Fixed (I'm sure there are others, still getting into the hang of that). > > +static RAMBlock *ram_find_block(const char *id) > > just a suggestion, not very particular about this: rename to > > ram_find_block_by_id() > > instead, so that it's clear what method of finding we're using; also > no name conflicts when there might be other ways of doing a find. Done. Dave > > Amit -- Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK