From: Ian Campbell Date: Mon, 10 Dec 2007 15:04:49 +0000 (+0000) Subject: Setup memory zones in the same way as native instead of putting all X-Git-Tag: xen-3.2.0~51 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=60c06b7614cde6eb3efcd0d6d6d15cfd9cbcc12c;p=legacy%2Flinux-2.6.18-xen.git Setup memory zones in the same way as native instead of putting all low memory in ZONE_DMA. There is no real benefit from diverging from native in this respect. Signed-off-by: Ian Campbell --- diff --git a/arch/i386/kernel/setup-xen.c b/arch/i386/kernel/setup-xen.c index bd6d29d6..3c05e3b5 100644 --- a/arch/i386/kernel/setup-xen.c +++ b/arch/i386/kernel/setup-xen.c @@ -1305,14 +1305,7 @@ void __init zone_sizes_init(void) unsigned long zones_size[MAX_NR_ZONES] = {0, 0, 0}; unsigned int max_dma, low; - /* - * XEN: Our notion of "DMA memory" is fake when running over Xen. - * We simply put all RAM in the DMA zone so that those drivers which - * needlessly specify GFP_DMA do not get starved of RAM unnecessarily. - * Those drivers that *do* require lowmem are screwed anyway when - * running over Xen! - */ - max_dma = max_low_pfn; + max_dma = virt_to_phys((char *)MAX_DMA_ADDRESS) >> PAGE_SHIFT; low = max_low_pfn; if (low < max_dma) diff --git a/arch/x86_64/mm/init-xen.c b/arch/x86_64/mm/init-xen.c index d9650188..77a32101 100644 --- a/arch/x86_64/mm/init-xen.c +++ b/arch/x86_64/mm/init-xen.c @@ -775,14 +775,11 @@ size_zones(unsigned long *z, unsigned long *h, unsigned long start_pfn, unsigned long end_pfn) { int i; -#ifndef CONFIG_XEN unsigned long w; -#endif for (i = 0; i < MAX_NR_ZONES; i++) z[i] = 0; -#ifndef CONFIG_XEN if (start_pfn < MAX_DMA_PFN) z[ZONE_DMA] = MAX_DMA_PFN - start_pfn; if (start_pfn < MAX_DMA32_PFN) { @@ -823,11 +820,6 @@ size_zones(unsigned long *z, unsigned long *h, h[ZONE_DMA] = z[ZONE_DMA]; } } -#else - z[ZONE_DMA] = end_pfn; - for (i = 0; i < MAX_NR_ZONES; i++) - h[i] = 0; -#endif } #ifndef CONFIG_NUMA