From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47408) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YAxvh-0004yZ-UW for qemu-devel@nongnu.org; Tue, 13 Jan 2015 04:38:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YAxva-0000wd-RY for qemu-devel@nongnu.org; Tue, 13 Jan 2015 04:38:29 -0500 Received: from mx1.redhat.com ([209.132.183.28]:54028) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YAxva-0000oj-Hu for qemu-devel@nongnu.org; Tue, 13 Jan 2015 04:38:22 -0500 Date: Tue, 13 Jan 2015 09:38:15 +0000 From: "Dr. David Alan Gilbert" Message-ID: <20150113093815.GA5193@work-vm> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] Question regarding two variables in qemu migration code List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jidong Xiao Cc: qemu-devel * Jidong Xiao (jidong.xiao@gmail.com) wrote: > Hi, Hi, > I am looking at the qemu source code, and trying to understand the > migration part. In arch_init.c, there are two variables which seems > quite confusing to me, > > They are: > > static uint64_t migration_dirty_pages; 'migration_dirty_pages' is the number of pages that are currently known that need to be sent to the destination; it goes down whenever we send a page, but goes up when we sync the dirty bitmap that tells us that something changed the data in the page (see migration_bitmap_sync_range ) > static int64_t num_dirty_pages_period; // defined in function > migration_bitmap_sync() This is looking how many pages we've noticed are now dirty within a particular time - to try and get an estimate of how fast memory is changing If you see migration_bitmap_sync has an: if (end_time > start_time + 1000) { and inside there it uses num_dirty_pages_period to update dirty_pages_rate. > > Can anyone kindly explain that what does these two variables mean? Thanks. > > -Jidong Dave -- Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK