]> xenbits.xensource.com Git - xen.git/commitdiff
Add debug code to catch count_info errors in page_alloc.c
authorKeir Fraser <keir.fraser@citrix.com>
Thu, 12 Mar 2009 15:37:12 +0000 (15:37 +0000)
committerKeir Fraser <keir.fraser@citrix.com>
Thu, 12 Mar 2009 15:37:12 +0000 (15:37 +0000)
This patch is temporary.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
xen/common/page_alloc.c
xen/common/sysctl.c

index eb07404e7afc4704eb8fd52ace311077de6e1d6b..fbc75cbddec1cdf1a9046b18c236ba5a6c18a9ff 100644 (file)
@@ -403,6 +403,9 @@ static struct page_info *alloc_heap_pages(
     for ( i = 0; i < (1 << order); i++ )
     {
         /* Reference count must continuously be zero for free pages. */
+        if ( pg[i].count_info != 0 )
+            printk("** %s:%d -- %u/%u %lx\n", __FILE__, __LINE__,
+                   i, 1 << order, pg[i].count_info);
         BUG_ON(pg[i].count_info != 0);
 
         if ( pg[i].u.free.need_tlbflush )
@@ -527,7 +530,10 @@ static void free_heap_pages(
          *     in its pseudophysical address space).
          * In all the above cases there can be no guest mappings of this page.
          */
-        ASSERT(!(pg[i].count_info & PGC_offlined));
+        if ( pg[i].count_info & PGC_offlined )
+            printk("** %s:%d -- %u/%u %lx\n", __FILE__, __LINE__,
+                   i, 1 << order, pg[i].count_info);
+        BUG_ON(pg[i].count_info & PGC_offlined);
         pg[i].count_info &= PGC_offlining | PGC_broken;
         if ( pg[i].count_info & PGC_offlining )
         {
index 898cdc1e58f4bf07e1e3fc21a7980bf4ffa0e18e..0a4726e8efa6b923eb0b7aa782161fede4fa55d4 100644 (file)
@@ -238,6 +238,8 @@ long do_sysctl(XEN_GUEST_HANDLE(xen_sysctl_t) u_sysctl)
         uint32_t *status, *ptr;
         unsigned long pfn;
 
+        BUG();
+
         ptr = status = xmalloc_bytes( sizeof(uint32_t) *
                                 (op->u.page_offline.end -
                                   op->u.page_offline.start + 1));