Skip to contentSkip to conversation

PoD: Allocate 4k pages if 2 meg allocation fails

PATCH In review George Dunlap 2 participants 2 messages Sep 24, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

#1 lore raw

Including the patch...

Quoted 6 lines · George Dunlap

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.

xen/arch/x86/mm/p2m.c +13 -1
diff -r f0af9a2abbf2 xen/arch/x86/mm/p2m.c
@@ -386,10 +386,22 @@
             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-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel