From: "Jan Beulich" Subject: Re: [PATCH] x86: fix domain cleanup Date: Tue, 28 Oct 2008 11:43:00 +0000 Message-ID: <490708D4.76E4.0078.0@novell.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: Content-Disposition: inline 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 Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org >>> Keir Fraser 28.10.08 12:15 >>> >Actually I'm not sure how PGT_partial reference counting works either. Do >such pages hold a general reference count? It appears not, so I don't see >why for example we couldn't have the put_page() in >get_page_and_type_from_pagenr() cause free_domheap_pages() and then = BUG_ON() >the fact that the type count is non-zero (because it is partially >validated). Correct, that's the second bug I referred to. I think that we have to = retain a general reference for a partially validated page. >Shouldn't free_domheap_pages() do cleanup for partially validated pages? I don't think that would be the right place. This should be naturally done in the normal code paths, by ensuring (which I think we do) to always check for PGT_partial along with PGT_validated. >Is it possible or necessary to tell the difference between a page that is >partially alloc_page_type()d versus one which is partially >free_page_type()d? (e.g., are the reference counts left in different = states >in each case, and does that matter?) I think it's unnecessary to distinguish these, as long as the page's state doesn't differ when getting its PGT_partial flag set either way. And I believe that state is consistent at present (apart from the missing page reference, which however is consistently missing in both cases). Jan