[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [Xen-devel] RE: transferring ownership of domheap pages



> 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

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.