]> xenbits.xensource.com Git - xen.git/commitdiff
x86/mm: warn if we ever run out of shadow/hap pool for p2m/lgd ops.
authorTim Deegan <tim@xen.org>
Thu, 7 Mar 2013 12:49:52 +0000 (12:49 +0000)
committerTim Deegan <tim@xen.org>
Thu, 14 Mar 2013 10:33:46 +0000 (10:33 +0000)
Even if the error propagates up through the p2m ops to the caller,
it'll look like ENOMEM, which won't be obviously a shadow-pool problem.

Warn on the console, once per domain.

Reported-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Tim Deegan <tim@xen.org>
Acked-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/mm/hap/hap.c
xen/arch/x86/mm/shadow/common.c
xen/include/asm-x86/domain.h

index 055833d349aadeb2492d99b997f21163d8b2e018..bff05d97a31e76e498454914cd343c500b7878bb 100644 (file)
@@ -258,6 +258,12 @@ static struct page_info *hap_alloc_p2m_page(struct domain *d)
         page_set_owner(pg, d);
         pg->count_info |= 1;
     }
+    else if ( !d->arch.paging.p2m_alloc_failed )
+    {
+        d->arch.paging.p2m_alloc_failed = 1;
+        dprintk(XENLOG_ERR, "d%i failed to allocate from HAP pool",
+                d->domain_id);
+    }
 
     paging_unlock(d);
     return pg;
index 691776c8abe76e8d8194e9201d1de89d5b35ccee..4b576ac0630aca75abb74ef0e460f433a641b083 100644 (file)
@@ -1591,10 +1591,16 @@ shadow_alloc_p2m_page(struct domain *d)
     if ( d->arch.paging.shadow.total_pages 
          < shadow_min_acceptable_pages(d) + 1 )
     {
+        if ( !d->arch.paging.p2m_alloc_failed )
+        {
+            d->arch.paging.p2m_alloc_failed = 1;
+            dprintk(XENLOG_ERR, "d%i failed to allocate from shadow pool",
+                    d->domain_id);
+        }
         paging_unlock(d);
         return NULL;
     }
+
     shadow_prealloc(d, SH_type_p2m_table, 1);
     pg = mfn_to_page(shadow_alloc(d, SH_type_p2m_table, 0));
     d->arch.paging.shadow.p2m_pages++;
index fd9fa0f2311ef3503c8a608b4966fd6fe020abc8..6f9744a58f59b550e6dd5a2ec6024933c2955620 100644 (file)
@@ -190,6 +190,8 @@ struct paging_domain {
      * (used by p2m and log-dirty code for their tries) */
     struct page_info * (*alloc_page)(struct domain *d);
     void (*free_page)(struct domain *d, struct page_info *pg);
+    /* Has that pool ever run out of memory? */
+    bool_t p2m_alloc_failed;
 };
 
 struct paging_vcpu {