From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:60827) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S2YWw-0006CF-MT for qemu-devel@nongnu.org; Tue, 28 Feb 2012 20:40:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S2YWu-0004is-6H for qemu-devel@nongnu.org; Tue, 28 Feb 2012 20:40:34 -0500 Received: from ozlabs.org ([203.10.76.45]:55731) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S2YWt-0004hL-Rn for qemu-devel@nongnu.org; Tue, 28 Feb 2012 20:40:32 -0500 Date: Wed, 29 Feb 2012 11:22:32 +1100 From: David Gibson Message-ID: <20120229002232.GR3433@truffala.fritz.box> References: <1330043012-30556-1-git-send-email-david@gibson.dropbear.id.au> <1330043012-30556-7-git-send-email-david@gibson.dropbear.id.au> <3712489A-FA0B-4685-A039-763F43AA14D4@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3712489A-FA0B-4685-A039-763F43AA14D4@suse.de> Subject: Re: [Qemu-devel] [PATCH 6/6] kvm: Fix dirty tracking with large kernel page size List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexander Graf Cc: Marcelo Tossatti , qemu-devel@nongnu.org, anthony@codemonkey.ws, Avi Kivity On Wed, Feb 29, 2012 at 12:32:51AM +0100, Alexander Graf wrote: > > On 24.02.2012, at 01:23, David Gibson wrote: > > > From: Benjamin Herrenschmidt > > > > If the kernel page size is larger than TARGET_PAGE_SIZE, which > > happens for example on ppc64 with kernels compiled for 64K pages, > > the dirty tracking doesn't work. > > > > Cc: Avi Kivity > > Cc: Marcelo Tossatti > > > > Signed-off-by: Benjamin Herrenschmidt > > Signed-off-by: David Gibson > > --- > > kvm-all.c | 7 ++++--- > > 1 files changed, 4 insertions(+), 3 deletions(-) > > > > diff --git a/kvm-all.c b/kvm-all.c > > index 5e188bf..3f8cfd9 100644 > > --- a/kvm-all.c > > +++ b/kvm-all.c > > @@ -348,10 +348,11 @@ static int kvm_set_migration_log(int enable) > > static int kvm_get_dirty_pages_log_range(MemoryRegionSection *section, > > unsigned long *bitmap) > > { > > - unsigned int i, j; > > + unsigned int i, j; > > unsigned long page_number, c; > > target_phys_addr_t addr, addr1; > > unsigned int len = ((section->size / TARGET_PAGE_SIZE) + HOST_LONG_BITS - 1) / HOST_LONG_BITS; > > + unsigned long hpratio = getpagesize() / TARGET_PAGE_SIZE; > > Actually, looking at this, don't we rather want to cache hpratio? > The way this is implemented, it would mean we'd do a sysctl for > every call, right? I think libc already caches this. -- David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson