From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53215) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WJJuJ-00052G-CQ for qemu-devel@nongnu.org; Fri, 28 Feb 2014 04:39:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WJJuE-00074S-Gr for qemu-devel@nongnu.org; Fri, 28 Feb 2014 04:39:03 -0500 Received: from mx1.redhat.com ([209.132.183.28]:46319) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WJJuE-00072w-7F for qemu-devel@nongnu.org; Fri, 28 Feb 2014 04:38:58 -0500 Date: Fri, 28 Feb 2014 09:37:31 +0000 From: "Dr. David Alan Gilbert" Message-ID: <20140228093729.GC2695@work-vm> References: <33183CC9F5247A488A2544077AF19020815D2278@SZXEMA503-MBS.china.huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <33183CC9F5247A488A2544077AF19020815D2278@SZXEMA503-MBS.china.huawei.com> Subject: Re: [Qemu-devel] [PATCH 2/7] migration: Add counters of updating the dirty bitmap List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Gonglei (Arei)" Cc: "chenliang (T)" , Peter Maydell , Juan Quintela , "pl@kamp.de" , "qemu-devel@nongnu.org" , "aliguori@amazon.com" , "pbonzini@redhat.com" * Gonglei (Arei) (arei.gonglei@huawei.com) wrote: > Add counters to log the times of updating the dirty bitmap. Reviewed-by: Dr. David Alan Gilbert > Signed-off-by: ChenLiang > Signed-off-by: Gonglei > --- > arch_init.c | 20 ++++++++++++++++++++ > 1 file changed, 20 insertions(+) > > diff --git a/arch_init.c b/arch_init.c > index bc8d0eb..6823c5a 100644 > --- a/arch_init.c > +++ b/arch_init.c > @@ -110,6 +110,23 @@ static bool mig_throttle_on; > static int dirty_rate_high_cnt; > static void check_guest_throttling(void); > > +static uint64_t bitmap_sync_cnt; > +/* the functions *_bitmap_sync_cnt only run in migrate thread */ > +static inline void reset_bitmap_sync_cnt(void) > +{ > + bitmap_sync_cnt = 0; > +} > + > +static inline void increase_bitmap_sync_cnt(void) > +{ > + bitmap_sync_cnt++; > +} > + > +static inline uint64_t get_bitmap_sync_cnt(void) > +{ > + return bitmap_sync_cnt; > +} > + > /***********************************************************/ > /* ram save/restore */ > > @@ -450,6 +467,8 @@ static void migration_bitmap_sync(void) > int64_t end_time; > int64_t bytes_xfer_now; > > + increase_bitmap_sync_cnt(); > + > if (!bytes_xfer_prev) { > bytes_xfer_prev = ram_bytes_transferred(); > } > @@ -692,6 +711,7 @@ static int ram_save_setup(QEMUFile *f, void *opaque) > migration_dirty_pages = ram_pages; > mig_throttle_on = false; > dirty_rate_high_cnt = 0; > + reset_bitmap_sync_cnt(); > > if (migrate_use_xbzrle()) { > XBZRLE.cache = cache_init(migrate_xbzrle_cache_size() / > -- > 1.7.12.4 > > > Best regards, > -Gonglei > > > -- Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK