From: Keir Fraser Subject: Re: free_domheap_pages() leaking xenheap pages? Date: Tue, 23 Jan 2007 16:32:06 +0000 Message-ID: References: <1169569502.29569.23.camel@lapbode42.lrr.in.tum.de> Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1169569502.29569.23.camel@lapbode42.lrr.in.tum.de> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Daniel Stodden , Xen Developers List-Id: xen-devel@lists.xenproject.org On 23/1/07 16:25, "Daniel Stodden" wrote: > the page range remains unlisted upon return, and if there's any later > point in the domain life cycle where these pages would ever return to > the xen heap, i'm unable to find it. There are very few xenheap pages that are ever shared with guests. These are shared_info and grant-table pages. We don't want the pages to be completely freed until the hypervisor is done with them which is not until domain_destruct(). But Xen itself cannot keep an explicit reference on the pages since that would stop the domain reference count ever falling to zero, which would prevent domain_destruct() from ever being called! So Xen does not increment the reference count and instead takes responsibility for 'manually' freeing the pages in domain_destruct() (at which point we know that there are no other references to those pages). -- Keir