WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] Re: [patch 11/21] Xen-paravirt: Add apply_to_page_range() wh

To: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] Re: [patch 11/21] Xen-paravirt: Add apply_to_page_range() which applies a function to a pte range.
From: Nick Piggin <nickpiggin@xxxxxxxxxxxx>
Date: Fri, 16 Feb 2007 18:31:14 +1100
Cc: Zachary Amsden <zach@xxxxxxxxxx>, Jeremy Fitzhardinge <jeremy@xxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxx, Ian Pratt <ian.pratt@xxxxxxxxxxxxx>, virtualization@xxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, Chris Wright <chrisw@xxxxxxxxxxxx>, Andi Kleen <ak@xxxxxx>, David Rientjes <rientjes@xxxxxxxxxx>, Christoph Lameter <clameter@xxxxxxx>, Linux Memory Management <linux-mm@xxxxxxxxx>, Christian Limpach <Christian.Limpach@xxxxxxxxxxxx>
Delivery-date: Fri, 16 Feb 2007 05:34:56 -0800
Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com.au; h=Received:X-YMail-OSG:Message-ID:Date:From:User-Agent:X-Accept-Language:MIME-Version:To:CC:Subject:References:In-Reply-To:Content-Type:Content-Transfer-Encoding; b=j0937vSADIoSpw0FoYFQQ5jfSKPtCrY4plYuBV0bWevljH4hWsfZvFfrR6Hm2/zWhGZkYPqxyqjCBfbFmgklcMJ5L2AhSb5gLae9UOnKn3Jnh6mB5ErPXe19BQJhxQ3XfWRe4Izpwnix0PaqZaMgYW/9s/Op3hZ77NTSpHms/qc= ;
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <20070215223727.6819f962.akpm@xxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <20070216022449.739760547@xxxxxxxx> <20070216022531.344125142@xxxxxxxx> <20070215223727.6819f962.akpm@xxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.12) Gecko/20051007 Debian/1.7.12-1
Andrew Morton wrote:
On Thu, 15 Feb 2007 18:25:00 -0800 Jeremy Fitzhardinge <jeremy@xxxxxxxx> wrote:


Add a new mm function apply_to_page_range() which applies a given
function to every pte in a given virtual address range in a given mm
structure. This is a generic alternative to cut-and-pasting the Linux
idiomatic pagetable walking code in every place that a sequence of
PTEs must be accessed.

Although this interface is intended to be useful in a wide range of
situations, it is currently used specifically by several Xen
subsystems, for example: to ensure that pagetables have been allocated
for a virtual address range, and to construct batched special
pagetable update requests to map I/O memory (in ioremap()).


There was some discussion about this sort of thing last week.  The
consensus was that it's better to run the callback against a whole pmd's
worth of ptes, mainly to amortise the callback's cost (a lot).

It was implemented in
ftp://ftp.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.20/2.6.20-mm1/broken-out/smaps-extract-pmd-walker-from-smaps-code.patch


Speaking of that patch, I missed the discussion, but I'd hope it doesn't
go upstream in its current form.

We now have one way of walking range of ptes. The code may be duplicated a
few times, but it is simple, we know how it works, and it is easy to get
right because everyone does the same thing.

We used to have about a dozen slightly different ways of doing this until
Hugh spent the effort to standardise it all. Isn't it nice?

If we want an ever-so-slightly lower performing interface for those paths
that don't care to count every cycle -- which I think is a fine idea BTW
-- it should be implemented in mm/memory.c and it should use our standard
form of pagetable walking.

--
SUSE Labs, Novell Inc.
Send instant messages to your online friends http://au.messenger.yahoo.com

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>