From mboxrd@z Thu Jan 1 00:00:00 1970 From: Keir Fraser Subject: Re: [PATCH] x86/PAE partially linear page table support Date: Thu, 15 Feb 2007 11:58:17 +0000 Message-ID: References: <45D454F0.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: <45D454F0.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 , Keir Fraser Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org On 15/2/07 11:41, "Jan Beulich" wrote: >> How do you ensure that circular references are correctly cleaned up at >> domain destruction time? (i.e., A references B and B references A). >> >> We have special destructore code to clean up all root pagetable references, >> but the code isn't there for lower levels. > > put_page_from_l?e() are all symmetrical, i.e. should take care of such > references at any level. I don't think I know what other destructor code > is involved here. That's not what I mean. Say we have two L2 tables, A and B. A[0] references B and B[0] references A. Even when all external references to A and B have gone away (i.e., there are no references from L3 tables) the type counts of A and B will both be non-zero because of the circular reference. This will prevent the pages from being freed and, ultimately, can lead to the domain never being destroyed. This case needs to be handled. See the code just below the largest comment in arch/x86/domain.c:relinquish_memory() to see how it's handled for top-level pagetables. Unfortunately it doesn't quite trivially generalise. -- Keir