# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1254410112 -3600
# Node ID d1725e7a66b2fa42d8a502e9d0d876afeb5bbaf8
# Parent 502a69369482754ccb65bc130c3f5e0d32dffde9
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-unstable changeset: 20252:fa41a706d018
xen-unstable date: Fri Sep 25 10:47:36 2009 +0100
---
xen/arch/x86/mm/p2m.c | 14 +++++++++++++-
1 files changed, 13 insertions(+), 1 deletion(-)
diff -r 502a69369482 -r d1725e7a66b2 xen/arch/x86/mm/p2m.c
--- a/xen/arch/x86/mm/p2m.c Thu Oct 01 16:14:40 2009 +0100
+++ b/xen/arch/x86/mm/p2m.c Thu Oct 01 16:15:12 2009 +0100
@@ -416,10 +416,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
|