From: Keir Fraser Subject: Re: RE: transferring ownership of domheap pages Date: Fri, 13 Feb 2009 15:23:01 +0000 Message-ID: References: <7a5163fb-cbb9-44b4-a6e8-76c63be97a5b@default> Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <7a5163fb-cbb9-44b4-a6e8-76c63be97a5b@default> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Dan Magenheimer , "Xen-Devel (E-mail)" List-Id: xen-devel@lists.xenproject.org On 13/02/2009 15:14, "Dan Magenheimer" 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