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

Re: [Xen-devel] [RFC] linux: add p[mug]d_clear_full() accessors

To: Jan Beulich <jbeulich@xxxxxxxxxx>
Subject: Re: [Xen-devel] [RFC] linux: add p[mug]d_clear_full() accessors
From: Jeremy Fitzhardinge <jeremy@xxxxxxxx>
Date: Tue, 20 May 2008 21:03:07 +0100
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Tue, 20 May 2008 13:04:01 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <48331043.76E4.0078.0@xxxxxxxxxx>
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: <4832FF91.76E4.0078.0@xxxxxxxxxx> <4832EB8F.8010405@xxxxxxxx> <48331043.76E4.0078.0@xxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 2.0.0.14 (X11/20080501)
Jan Beulich wrote:
In fact, in pvops-Xen, I set PG_pinned on all pinned pagetable pages (not just the top level), so you can tell whether you're updating a pinned pgd/pud/pmd without needing an mm on hand. So I think this optimisation can be implemented in current Linux entirely within the Xen-specific code.

Ah, I didn't realize that so far. However, 64-bit doesn't use a PG_*
flag for identifying pinned mm-s, because of a conflict in use of
PG_arch_1 in those older kernel versions. But as the conflict is gone
in recent kernel, I should indeed be able to synchronize 64-bit with
32-bit here, then follow your approach of marking all pinned page
tables, and finally get away without adding a new set of abstractions.

Yes, 64-bit has masses of free page flags, so we could allocate new ones if need be. But owner_priv_1 is definitely available for Xen's use, so it may as well be common (indeed, I'd expect all the existing code to just work on 64-bit at the moment, though perhaps its missing some 4th-level pagetable stuff in places, and testing).

One question though - in our 2.6.23 merge (where pv-ops-Xen's
PG_pinned appeared as an alias of PG_owner_priv_1, and where
PG_arch_1 got assigned a meaning for native x86, so PG_pinned
for the traditional patches needed to change anyway) I intentionally
didn't follow pv-ops for our patches, since PG_pinned is among the
flags bad_page() checks for (in the XenSource tree, and I think this
should really also be done in upstream Linux), and hence re-using
the bit here would change behavior for other parts of the kernel.

I don't think so. So long as its clear by the time you free the page, it doesn't matter how it gets used in the meantime (after all, you should never free a pinned pagetable page).

In general, almost all the page flags are available for our use in pagetable pages. The pages are privately owned by Xen, and don't participate in any of the mm/ code, so there's no conflict if we use the bits for something else. For example, in my Xen save/restore patches, I've overloaded PG_dirty to mean pinned-for-suspend, and there's no conflict with any other users.

   J

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