From: Keir Fraser Subject: Re: xenheap pages mapped by dom0 Date: Fri, 18 Dec 2009 16:40:37 +0000 Message-ID: References: <4B2BAB77.3020508@eu.citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <4B2BAB77.3020508@eu.citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: George Dunlap , Jan Beulich Cc: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org On 18/12/2009 16:19, "George Dunlap" wrote: > However, that brings up another point: suppose that I do several > allocations, one per cpu, and one fails. Now I want to go and free the > buffers I've just allocated (which shouldn't be mapped in dom0 yet). > Can I not just call free_xenheap_pages()? Do I need to clear > PGC_allocated before calling? Once you have called share_xen_page_with_guest(), dom0 can map that page at any time and it is not safe to free_xenheap_page() without first checking for guest mappings. Perhaps you can lazily adjust tarce buffers downwards in size? I.e. Have a go, remember if you fail, and try again on future buffer-adjustment hypercalls? > Is any of this stuff written down somewhere? :-) No. :-) -- Keir