diff -Nur xen/arch/x86/x86_32/mm.c new-xen/arch/x86/x86_32/mm.c --- xen/arch/x86/x86_32/mm.c 2006-05-18 03:07:55.000000000 -0400 +++ new-xen/arch/x86/x86_32/mm.c 2006-05-18 03:06:12.000000000 -0400 @@ -62,6 +62,8 @@ return &idle_pg_table_l2[l2_linear_offset(v)]; } +extern unsigned long lowmem_emergency_pool_pages; + void __init paging_init(void) { void *ioremap_pt; @@ -126,6 +128,18 @@ l2e_from_page(virt_to_page(idle_vcpu[0]->domain-> arch.mm_perdomain_pt) + i, __PAGE_HYPERVISOR); + + /* + * Size the lowmem_emergency_pool based on the total memory on the box + * This pool is needed only on 32 bit PAE configurations (4g to 16g). + */ + if (lowmem_emergency_pool_pages) + return; + if ((total_pages > (1000 * 1000) && (total_pages <= (2000*1000)))) { + lowmem_emergency_pool_pages = 4000; + } else if ((total_pages > (2000 * 1000) && (total_pages < (4*1000*1000)))) { + lowmem_emergency_pool_pages = 8000; + } } void __init zap_low_mappings(l2_pgentry_t *base) diff -Nur xen/common/page_alloc.c new-xen/common/page_alloc.c --- xen/common/page_alloc.c 2006-05-18 03:07:20.000000000 -0400 +++ new-xen/common/page_alloc.c 2006-05-18 03:03:45.000000000 -0400 @@ -47,7 +47,7 @@ * allocation requests. Ordinary requests will not fall back to the * lowmem emergency pool. */ -static unsigned long lowmem_emergency_pool_pages; +unsigned long lowmem_emergency_pool_pages; static void parse_lowmem_emergency_pool(char *s) { unsigned long long bytes;