From: "Jan Beulich" Subject: Re: [PATCH 1/5] VT-d support for PV guests Date: Tue, 20 May 2008 08:14:20 +0100 Message-ID: <4832966C.76E4.0078.0@novell.com> References: <18481.58194.426124.386871@gargle.gargle.HOWL> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <18481.58194.426124.386871@gargle.gargle.HOWL> 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: Espen Skoglund Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org >--- a/xen/arch/x86/domain.c Mon May 19 20:32:22 2008 +0100 >+++ b/xen/arch/x86/domain.c Mon May 19 20:42:54 2008 +0100 >@@ -127,12 +127,15 @@ > void dump_pageframe_info(struct domain *d) > { > struct page_info *page; >+ int cnt[8] =3D { 0, 0, 0, 0, 0, 0, 0, 0 }; >=20 > printk("Memory pages belonging to domain %u:\n", d->domain_id); >=20 > if ( d->tot_pages >=3D 10 ) > { > printk(" DomPage list too long to display\n"); >+ list_for_each_entry ( page, &d->page_list, list ) >+ cnt[(page->u.inuse.type_info >> 29) & 0x7]++; > } > else > { >@@ -141,8 +144,12 @@ > printk(" DomPage %p: caf=3D%08x, taf=3D%" PRtype_info = "\n", > _p(page_to_mfn(page)), > page->count_info, page->u.inuse.type_info); >+ cnt[(page->u.inuse.type_info >> 29) & 0x7]++; > } > } >+ printk(" TypeCnt " >+ "{ none %d, L1 %d, L2 %d, L3 %d, L4 %d, seg %d, rw %d }\n", >+ cnt[0], cnt[1], cnt[2], cnt[3], cnt[4], cnt[5], cnt[7]); >=20 > list_for_each_entry ( page, &d->xenpage_list, list ) > { Even if just used for debug output, I think using hard-coded numbers here is as unacceptable as it would be anywhere else. Jan