From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: Re: [PATCH v2] x86: make dump_pageframe_info() slightly more verbose for dying domains Date: Wed, 24 Sep 2014 16:34:47 +0100 Message-ID: <5422E497.3070605@citrix.com> References: <5422FEA60200007800038690@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============8840785349337028002==" Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1XWoam-0000Vd-6D for xen-devel@lists.xenproject.org; Wed, 24 Sep 2014 15:34:56 +0000 In-Reply-To: <5422FEA60200007800038690@mail.emea.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich , xen-devel Cc: Keir Fraser List-Id: xen-devel@lists.xenproject.org --===============8840785349337028002== Content-Type: multipart/alternative; boundary="------------080901060109010602000702" --------------080901060109010602000702 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit On 24/09/14 16:25, Jan Beulich wrote: > Allowing more than just 10 pages to be printed in this case gives a > better chance to fully understand eventual page reference leaks: Report > up to 16 "normal" (writable or untyped) pages, and an unlimited number > of special type (page or descriptor table) ones. > > Signed-off-by: Jan Beulich Reviewed-by: Andrew Cooper > --- > v2: Use MASK_EXTR() and extend description. > > --- a/xen/arch/x86/domain.c > +++ b/xen/arch/x86/domain.c > @@ -151,15 +151,29 @@ void dump_pageframe_info(struct domain * > > printk("Memory pages belonging to domain %u:\n", d->domain_id); > > - if ( d->tot_pages >= 10 ) > + if ( d->tot_pages >= 10 && d->is_dying < DOMDYING_dead ) > { > printk(" DomPage list too long to display\n"); > } > else > { > + unsigned long total[MASK_EXTR(PGT_type_mask, PGT_type_mask) + 1] = {}; > + > spin_lock(&d->page_alloc_lock); > page_list_for_each ( page, &d->page_list ) > { > + unsigned int index = MASK_EXTR(page->u.inuse.type_info, > + PGT_type_mask); > + > + if ( ++total[index] > 16 ) > + { > + switch ( page->u.inuse.type_info & PGT_type_mask ) > + { > + case PGT_none: > + case PGT_writable_page: > + continue; > + } > + } > printk(" DomPage %p: caf=%08lx, taf=%" PRtype_info "\n", > _p(page_to_mfn(page)), > page->count_info, page->u.inuse.type_info); > > > > > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xen.org > http://lists.xen.org/xen-devel --------------080901060109010602000702 Content-Type: text/html; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit
On 24/09/14 16:25, Jan Beulich wrote:
Allowing more than just 10 pages to be printed in this case gives a
better chance to fully understand eventual page reference leaks: Report
up to 16 "normal" (writable or untyped) pages, and an unlimited number
of special type (page or descriptor table) ones.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>

---
v2: Use MASK_EXTR() and extend description.

--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -151,15 +151,29 @@ void dump_pageframe_info(struct domain *
 
     printk("Memory pages belonging to domain %u:\n", d->domain_id);
 
-    if ( d->tot_pages >= 10 )
+    if ( d->tot_pages >= 10 && d->is_dying < DOMDYING_dead )
     {
         printk("    DomPage list too long to display\n");
     }
     else
     {
+        unsigned long total[MASK_EXTR(PGT_type_mask, PGT_type_mask) + 1] = {};
+
         spin_lock(&d->page_alloc_lock);
         page_list_for_each ( page, &d->page_list )
         {
+            unsigned int index = MASK_EXTR(page->u.inuse.type_info,
+                                           PGT_type_mask);
+
+            if ( ++total[index] > 16 )
+            {
+                switch ( page->u.inuse.type_info & PGT_type_mask )
+                {
+                case PGT_none:
+                case PGT_writable_page:
+                    continue;
+                }
+            }
             printk("    DomPage %p: caf=%08lx, taf=%" PRtype_info "\n",
                    _p(page_to_mfn(page)),
                    page->count_info, page->u.inuse.type_info);





_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

--------------080901060109010602000702-- --===============8840785349337028002== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel --===============8840785349337028002==--