From: iap10@freefall.cl.cam.ac.uk Date: Wed, 9 Mar 2005 18:31:15 +0000 (+0000) Subject: bitkeeper revision 1.1236.19.2 (422f40f3l62sGOkmaI-pc1lI7OvE-A) X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~17857^2~61^2^2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=9a7ca251a340ce315c00a85c02d5b743929d5f42;p=xen.git bitkeeper revision 1.1236.19.2 (422f40f3l62sGOkmaI-pc1lI7OvE-A) audit_pagelist added for debugging. Signed-off-by: ian@xensource.com --- diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c index 158dbb6306..a74bfaac5e 100644 --- a/xen/arch/x86/mm.c +++ b/xen/arch/x86/mm.c @@ -104,7 +104,7 @@ #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);