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] RE: transferring ownership of domheap pages

To: Keir Fraser <keir.fraser@xxxxxxxxxxxxx>, "Xen-Devel (E-mail)" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: RE: [Xen-devel] RE: transferring ownership of domheap pages
From: Dan Magenheimer <dan.magenheimer@xxxxxxxxxx>
Date: Fri, 13 Feb 2009 17:02:24 +0000 (GMT)
Cc:
Delivery-date: Fri, 13 Feb 2009 09:03:51 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <C5BB40D5.1E83%keir.fraser@xxxxxxxxxxxxx>
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/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
> A benefit of using steal_page() is
> that we will maintain that for other callers

OK, I'll use steal_page(), though I think it is
overkill as the pages I am dealing with are not
addressable outside of the hypervisor, so there
aren't any mappings being created and destroyed.

I still need code for the other direction though:
I have an anonymous page (on my own private "free"
page_list) and I want it to be owned by a domain,
but I don't want to free it and then alloc it
(because I might not get the same page back).

Does the attached patch look good?  Are there
any races that I am missing?  Is the name
("donate_page" opposite of "steal_page") OK?

Thanks,
Dan


> -----Original Message-----
> From: Keir Fraser [mailto:keir.fraser@xxxxxxxxxxxxx]
> Sent: Friday, February 13, 2009 8:23 AM
> To: Dan Magenheimer; Xen-Devel (E-mail)
> Subject: Re: [Xen-devel] RE: transferring ownership of domheap pages
> 
> 
> On 13/02/2009 15:14, "Dan Magenheimer" 
> <dan.magenheimer@xxxxxxxxxx> wrote:
> 
> >> Yeah, that's pretty... optimistic. ;-)
> > 
> > What else do you see that is missing in my first cut?
> > Do you see any other code there that's just wrong?
> 
> You can't just assert that count_info == PGC_allocated|1, for 
> example. You
> need to be careful that mappings aren't created or destroyed 
> while you are
> changing the ownership. Steal_page() does that. Once a page 
> is anonymous,
> transferring it to a domain is easier, since mappings can't be
> created/destroyed while it is anonymous. So steal_page() just 
> does the hard
> transition for you (non-anon -> anon). A benefit of using 
> steal_page() is
> that we will maintain that for other callers -- a private 
> implementation in
> tmem risks getting subtly unsafely broken every now and then.
> 
>  -- Keir
> 
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@xxxxxxxxxxxxxxxxxxx
> http://lists.xensource.com/xen-devel
>

Attachment: donatepage.patch
Description: Binary data

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