ia64/xen-unstable

changeset 19349:97f78142cd4c

Add debug code to catch count_info errors in page_alloc.c

This patch is temporary.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Thu Mar 12 15:37:12 2009 +0000 (2009-03-12)
parents dd3219cd019a
children b4f3a52c359e
files xen/common/page_alloc.c xen/common/sysctl.c
line diff
     1.1 --- a/xen/common/page_alloc.c	Thu Mar 12 15:31:36 2009 +0000
     1.2 +++ b/xen/common/page_alloc.c	Thu Mar 12 15:37:12 2009 +0000
     1.3 @@ -403,6 +403,9 @@ static struct page_info *alloc_heap_page
     1.4      for ( i = 0; i < (1 << order); i++ )
     1.5      {
     1.6          /* Reference count must continuously be zero for free pages. */
     1.7 +        if ( pg[i].count_info != 0 )
     1.8 +            printk("** %s:%d -- %u/%u %lx\n", __FILE__, __LINE__,
     1.9 +                   i, 1 << order, pg[i].count_info);
    1.10          BUG_ON(pg[i].count_info != 0);
    1.11  
    1.12          if ( pg[i].u.free.need_tlbflush )
    1.13 @@ -527,7 +530,10 @@ static void free_heap_pages(
    1.14           *     in its pseudophysical address space).
    1.15           * In all the above cases there can be no guest mappings of this page.
    1.16           */
    1.17 -        ASSERT(!(pg[i].count_info & PGC_offlined));
    1.18 +        if ( pg[i].count_info & PGC_offlined )
    1.19 +            printk("** %s:%d -- %u/%u %lx\n", __FILE__, __LINE__,
    1.20 +                   i, 1 << order, pg[i].count_info);
    1.21 +        BUG_ON(pg[i].count_info & PGC_offlined);
    1.22          pg[i].count_info &= PGC_offlining | PGC_broken;
    1.23          if ( pg[i].count_info & PGC_offlining )
    1.24          {
     2.1 --- a/xen/common/sysctl.c	Thu Mar 12 15:31:36 2009 +0000
     2.2 +++ b/xen/common/sysctl.c	Thu Mar 12 15:37:12 2009 +0000
     2.3 @@ -238,6 +238,8 @@ long do_sysctl(XEN_GUEST_HANDLE(xen_sysc
     2.4          uint32_t *status, *ptr;
     2.5          unsigned long pfn;
     2.6  
     2.7 +        BUG();
     2.8 +
     2.9          ptr = status = xmalloc_bytes( sizeof(uint32_t) *
    2.10                                  (op->u.page_offline.end -
    2.11                                    op->u.page_offline.start + 1));