]> rtime.felk.cvut.cz Git - can-eth-gw-linux.git/commitdiff
x86, mm: Allow ZONE_DMA to be configurable
authorDavid Rientjes <rientjes@google.com>
Mon, 16 May 2011 20:54:10 +0000 (13:54 -0700)
committerH. Peter Anvin <hpa@linux.intel.com>
Mon, 16 May 2011 21:03:28 +0000 (14:03 -0700)
ZONE_DMA is unnecessary for a large number of machines that do not
require less than 32-bit DMA addressing, e.g. ISA legacy DMA or PCI
cards with a restricted DMA address mask.

This patch allows users to disable ZONE_DMA for x86 if they know they
will not be using such devices with their kernel.

This prevents the VM from unnecessarily reserving a ratio of memory
(defaulting to 1/256th of system capacity) with lowmem_reserve_ratio
for such allocations when it will never be used.

Signed-off-by: David Rientjes <rientjes@google.com>
Link: http://lkml.kernel.org/r/alpine.DEB.2.00.1105161353560.4353@chino.kir.corp.google.com
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
arch/x86/Kconfig
arch/x86/mm/init_32.c
arch/x86/mm/init_64.c

index 648fca42ae6af1ec31d60a4ce3696ff496124d4e..0eb801a75deedb123fa93575a98b8e503855c59a 100644 (file)
@@ -112,7 +112,14 @@ config MMU
        def_bool y
 
 config ZONE_DMA
-       def_bool y
+       bool "DMA memory allocation support" if EXPERT
+       default y
+       help
+         DMA memory allocation support allows devices with less than 32-bit
+         addressing to allocate within the first 16MB of address space.
+         Disable if no such devices will be used.
+
+         If unsure, say Y.
 
 config SBUS
        bool
index 2cde0a34bed65d39878bef6fe572c0ba5ef2fb56..29f7c6d981790cea29114c1b20d7cb54904a702e 100644 (file)
@@ -678,8 +678,10 @@ static void __init zone_sizes_init(void)
 {
        unsigned long max_zone_pfns[MAX_NR_ZONES];
        memset(max_zone_pfns, 0, sizeof(max_zone_pfns));
+#ifdef CONFIG_ZONE_DMA
        max_zone_pfns[ZONE_DMA] =
                virt_to_phys((char *)MAX_DMA_ADDRESS) >> PAGE_SHIFT;
+#endif
        max_zone_pfns[ZONE_NORMAL] = max_low_pfn;
 #ifdef CONFIG_HIGHMEM
        max_zone_pfns[ZONE_HIGHMEM] = highend_pfn;
index 0404bb3a077e4af0d72ba8a7ebc357b59e6a86aa..d865c4aeec55fb6c57638006c0a05e8fec30aed1 100644 (file)
@@ -616,7 +616,9 @@ void __init paging_init(void)
        unsigned long max_zone_pfns[MAX_NR_ZONES];
 
        memset(max_zone_pfns, 0, sizeof(max_zone_pfns));
+#ifdef CONFIG_ZONE_DMA
        max_zone_pfns[ZONE_DMA] = MAX_DMA_PFN;
+#endif
        max_zone_pfns[ZONE_DMA32] = MAX_DMA32_PFN;
        max_zone_pfns[ZONE_NORMAL] = max_pfn;