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: Dan Magenheimer <dan.magenheimer@xxxxxxxxxx>, "Xen-Devel (E-mail)" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: Re: [Xen-devel] RE: transferring ownership of domheap pages
From: Keir Fraser <keir.fraser@xxxxxxxxxxxxx>
Date: Fri, 13 Feb 2009 17:11:47 +0000
Cc:
Delivery-date: Fri, 13 Feb 2009 09:12:18 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <11851cfd-8be0-40bd-8eb5-48bc755f6bcd@default>
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
Thread-index: AcmN/PyMuwWlDwfjSUmyzXeFntwfFQAASpRu
Thread-topic: [Xen-devel] RE: transferring ownership of domheap pages
User-agent: Microsoft-Entourage/12.15.0.081119
On 13/02/2009 17:02, "Dan Magenheimer" <dan.magenheimer@xxxxxxxxxx> wrote:

>> 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.

If you're sure of that then indeed you don't need steal_page(). But usually
you could not be sure of that if the page owner is non-NULL -- the whole
point of that is to allow the owner to make mappings as it likes. If you've
got extra mechanism to ensure your extra restrictions hold then you will
know better than me whether your previous patch is correct or not.

> 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?

Roughly. You do need to check d->is_dying so you don't race domain
destruction. Look at share_xen_page_with_guest() -- your function is sort of
a subset of that.

 -- Keir



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