]> xenbits.xensource.com Git - legacy/linux-2.6.18-xen.git/commitdiff
Setup memory zones in the same way as native instead of putting all
authorIan Campbell <ian.campbell@citrix.com>
Mon, 10 Dec 2007 15:04:49 +0000 (15:04 +0000)
committerIan Campbell <ian.campbell@citrix.com>
Mon, 10 Dec 2007 15:04:49 +0000 (15:04 +0000)
low memory in ZONE_DMA. There is no real benefit from diverging from
native in this respect.

Signed-off-by: Ian Campbell <ian.campbell@xensource.com>
arch/i386/kernel/setup-xen.c
arch/x86_64/mm/init-xen.c

index bd6d29d6d65e1d90ded677b01435adad038c2098..3c05e3b5659f845f2a24a89e9c454265ead18791 100644 (file)
@@ -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)
index d965018840957772579d8e133b107d9e34d3bb64..77a32101640b793b0e736309f572530d7ad9772e 100644 (file)
@@ -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