]> xenbits.xensource.com Git - xen.git/commitdiff
bitkeeper revision 1.1236.19.2 (422f40f3l62sGOkmaI-pc1lI7OvE-A)
authoriap10@freefall.cl.cam.ac.uk <iap10@freefall.cl.cam.ac.uk>
Wed, 9 Mar 2005 18:31:15 +0000 (18:31 +0000)
committeriap10@freefall.cl.cam.ac.uk <iap10@freefall.cl.cam.ac.uk>
Wed, 9 Mar 2005 18:31:15 +0000 (18:31 +0000)
audit_pagelist added for debugging.
Signed-off-by: ian@xensource.com
xen/arch/x86/mm.c

index 158dbb6306731883d17f3c14518172abb2e3e118..a74bfaac5e9b6265364a4bfffd78872db5ebcc85 100644 (file)
 
 #ifdef VERBOSE
 #define MEM_LOG(_f, _a...)                           \
-  printk("DOM%u: (file=memory.c, line=%d) " _f "\n", \
+  printk("DOM%u: (file=mm.c, line=%d) " _f "\n", \
          current->domain->id , __LINE__ , ## _a )
 #else
 #define MEM_LOG(_f, _a...) ((void)0)
@@ -2566,6 +2566,31 @@ void ptwr_status(void)
     page = &frame_table[pfn];
 }
 
+void audit_pagelist(struct domain *d)
+{
+    struct list_head *list_ent;
+    int xenpages, totpages;
+
+    list_ent = d->xenpage_list.next;
+    for ( xenpages = 0; (list_ent != &d->xenpage_list); xenpages++ )
+    {
+        list_ent = list_ent->next;
+    }
+    list_ent = d->page_list.next;
+    for ( totpages = 0; (list_ent != &d->page_list); totpages++ )
+    {
+        list_ent = list_ent->next;
+    }
+
+    if ( xenpages != d->xenheap_pages ||
+         totpages != d->tot_pages )
+    {
+        printk("ARGH! dom %d: xen=%d %d, pages=%d %d\n",
+               xenpages, d->xenheap_pages, 
+               totpages, d->tot_pages );
+    }
+}
+
 void audit_domain(struct domain *d)
 {
     int ttot=0, ctot=0, io_mappings=0, lowmem_mappings=0;
@@ -2669,6 +2694,8 @@ void audit_domain(struct domain *d)
            
     spin_lock(&d->page_alloc_lock);
 
+    audit_pagelist(d);
+
     /* PHASE 0 */
 
     list_ent = d->page_list.next;
@@ -2969,13 +2996,13 @@ void audit_domain(struct domain *d)
         list_ent = frame_table[pfn].list.next;
     }
 
-    spin_unlock(&d->page_alloc_lock);
 
     if ( pagetable_val(d->exec_domain[0]->arch.guest_table) )
         adjust(&frame_table[pagetable_val(
             d->exec_domain[0]->arch.guest_table)>>PAGE_SHIFT], 1, 1);
 
-    printk("Audit %d: Done. pages=%d l1=%d l2=%d ctot=%d ttot=%d\n", d->id, i, l1, l2, ctot, ttot );
+    spin_unlock(&d->page_alloc_lock);
+    printk("Audit %d: Done. ref=%d xenpages=%d pages=%d l1=%d l2=%d ctot=%d ttot=%d\n", d->id, atomic_read(&d->refcnt), d->xenheap_pages, d->tot_pages, l1, l2, ctot, ttot );
 
     if ( d != current->domain )
         domain_unpause(d);