From: Keir Fraser Subject: Re: [PATCH] x86: fix domain cleanup Date: Tue, 28 Oct 2008 12:06:07 +0000 Message-ID: References: <490708D4.76E4.0078.0@novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <490708D4.76E4.0078.0@novell.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: Jan Beulich Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org On 28/10/08 11:43, "Jan Beulich" wrote: >>>> 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. And who will ultimately destroy that reference if we e.g., xm destroy a guest? Are you hoping the circular-reference destruction logic will deal with this case also? Seems to me there would be a difference between preempted get_page_type() and preempted put_page_type() here -- in the latter case there is still a holder of the outstanding general reference count (the holder who tried to do the put_page_type() which got preempted) whereas in the former case the general reference count is not really held by anyone and so relinquish_memory() would indeed have to dispose of it? Basically messing with the general reference count seems pretty dangerous to me. I would have been inclined to put some destruction in free_domheap_pages() (although of course then that function also becomes potentially preemptible in future!). -- Keir