From: Dan Magenheimer Subject: RE: RE: transferring ownership of domheap pages Date: Fri, 13 Feb 2009 15:14:53 +0000 (GMT) Message-ID: <7a5163fb-cbb9-44b4-a6e8-76c63be97a5b@default> References: Mime-Version: 1.0 Content-Type: text/plain; charset=Windows-1252 Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Keir Fraser , "Xen-Devel (E-mail)" List-Id: xen-devel@lists.xenproject.org Hmm... it looks like steal_page() only works one way, from owned-by-d to anonymous, true? I need the other direction as well. Other than that, the only difference I see is that page->count_info is being cleared/set in a cmpxchg loop; I assume this is because multiple domains might be contending to use/unuse the page? I wonder if I need that given that in my case the page is never addressed by any domain, just used inside the hypervisor, and the owned-by-d is mostly for accounting purposes. > Yeah, that's pretty... optimistic. ;-)=20 What else do you see that is missing in my first cut? Do you see any other code there that's just wrong? Thanks, Dan > -----Original Message----- > From: Keir Fraser [mailto:keir.fraser@eu.citrix.com] > Sent: Friday, February 13, 2009 1:54 AM > To: Dan Magenheimer; Xen-Devel (E-mail) > Subject: Re: [Xen-devel] RE: transferring ownership of domheap pages >=20 >=20 > Yeah, that's pretty... optimistic. ;-) Use steal_page() plus=20 > whatever bits > of gnttab_transfer() you think you might need. If you can=20 > cleanly abstract > that into a common function all the better, but you probably=20 > won't need much > code in addition to steal_page() anyway. >=20 > -- Keir >=20 > On 13/02/2009 03:37, "Dan Magenheimer"=20 > wrote: >=20 > > Here's a first cut. Works only from anon to non-anon > > or non-anon to anon (not non-anon1 to non-anon2). > >=20 > >> -----Original Message----- > >> From: Dan Magenheimer > >> Sent: Thursday, February 12, 2009 5:59 PM > >> To: Xen-Devel (E-mail) > >> Subject: transferring ownership of domheap pages > >>=20 > >>=20 > >> I'd like to have routines to transfer ownership > >> of a page both from domain D1 to anonymous and > >> from anonymous to domain D2, without the necessity > >> of doing a free_domheap_pages followed by an > >> alloc_domheap_pages (primarily because I don't > >> want to scrub the page as I know it will be > >> immediately overwritten by the new owner). > >> The anon-to-D2 would fail (return NULL) if > >> D2 is fully allocated. > >>=20 > >> Any problems to watch out for? > >>=20 > >> Thanks, > >> Dan > >>=20 > >> P.S. Only has to work on 64-bit Xen if that matters. > >>=20 >=20 >=20 >