[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] PoD: Allocate 4k pages if 2 meg allocation fails



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1253872056 -3600
# Node ID fa41a706d0181e190512c9665f3e7654ca4ba2f6
# Parent  dc72e4fbab2783566a0757d1269205c9b663f520
PoD: Allocate 4k pages if 2 meg allocation fails

In p2m_pod_set_cache_target:
 * If a 2-meg allocation fails, try a 4k allocation
 * If both allocations fail, return -ENOMEM so that the domain build
   will fail.

Signed-off-by: George Dunlap <george.dunlap@xxxxxxxxxxxxx>
---
 xen/arch/x86/mm/p2m.c |   14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletion(-)

diff -r dc72e4fbab27 -r fa41a706d018 xen/arch/x86/mm/p2m.c
--- a/xen/arch/x86/mm/p2m.c     Fri Sep 25 10:46:13 2009 +0100
+++ b/xen/arch/x86/mm/p2m.c     Fri Sep 25 10:47:36 2009 +0100
@@ -386,10 +386,22 @@ p2m_pod_set_cache_target(struct domain *
             order = 9;
         else
             order = 0;
-
+    retry:
         page = alloc_domheap_pages(d, order, 0);
         if ( unlikely(page == NULL) )
+        {
+            if ( order == 9 )
+            {
+                /* If we can't allocate a superpage, try singleton pages */
+                order = 0;
+                goto retry;
+            }   
+            
+            printk("%s: Unable to allocate domheap page for pod cache.  target 
%lu cachesize %d\n",
+                   __func__, pod_target, p2md->pod.count);
+            ret = -ENOMEM;
             goto out;
+        }
 
         p2m_pod_cache_add(d, page, order);
     }

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.