public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] x86: allow ZONE_DMA to be configurable
@ 2010-10-14  0:15 David Rientjes
  2010-10-14  0:23 ` H. Peter Anvin
  2010-10-14  8:10 ` Andrew Morton
  0 siblings, 2 replies; 30+ messages in thread
From: David Rientjes @ 2010-10-14  0:15 UTC (permalink / raw)
  To: Ingo Molnar, H. Peter Anvin, Thomas Gleixner
  Cc: Casey Dahlin, x86, linux-kernel

ZONE_DMA is unnecessary for a large number of machines that do not
require addressing in the lower 16MB of memory because they do not use
ISA devices with 16-bit address registers (plus one page byte register).

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>
---
 arch/x86/Kconfig      |    7 ++++++-
 arch/x86/mm/init_32.c |    2 ++
 arch/x86/mm/init_64.c |    2 ++
 3 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -99,7 +99,12 @@ config MMU
 	def_bool y
 
 config ZONE_DMA
-	def_bool y
+	bool "DMA memory allocation support"
+	default y
+	help
+	  DMA memory allocation support allows old ISA devices with 16-bit
+	  address registers to allocate memory within the first 16MB of
+	  address space.  Disable if no such devices will be used.
 
 config SBUS
 	bool
diff --git a/arch/x86/mm/init_32.c b/arch/x86/mm/init_32.c
--- a/arch/x86/mm/init_32.c
+++ b/arch/x86/mm/init_32.c
@@ -740,8 +740,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;
diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
--- a/arch/x86/mm/init_64.c
+++ b/arch/x86/mm/init_64.c
@@ -598,7 +598,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;
 

^ permalink raw reply	[flat|nested] 30+ messages in thread

end of thread, other threads:[~2010-10-21 14:56 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-14  0:15 [patch] x86: allow ZONE_DMA to be configurable David Rientjes
2010-10-14  0:23 ` H. Peter Anvin
2010-10-14  0:42   ` David Rientjes
2010-10-14  0:44     ` H. Peter Anvin
2010-10-14  0:49       ` David Rientjes
2010-10-14  1:21         ` H. Peter Anvin
2010-10-14  1:48           ` David Rientjes
2010-10-14  2:38             ` H. Peter Anvin
2010-10-14  3:55               ` David Rientjes
2010-10-14  4:37             ` H. Peter Anvin
2010-10-14  4:46               ` David Rientjes
2010-10-14 15:38                 ` H. Peter Anvin
2010-10-14 16:00                   ` Pekka Enberg
2010-10-14 17:44                     ` H. Peter Anvin
2010-10-14 18:34                       ` Ingo Molnar
2010-10-14 19:35                         ` Andrew Morton
2010-10-14 20:40                           ` H. Peter Anvin
2010-10-15  3:03                             ` Ingo Molnar
2010-10-15  4:45                               ` H. Peter Anvin
2010-10-15  9:05                               ` David Rientjes
2010-10-15 15:06                                 ` H. Peter Anvin
2010-10-14 22:08                   ` David Rientjes
2010-10-14  8:10 ` Andrew Morton
2010-10-14  8:32   ` KOSAKI Motohiro
2010-10-14 22:15   ` David Rientjes
2010-10-14 22:32     ` Andrew Morton
2010-10-15  3:10       ` Ingo Molnar
2010-10-15  9:11         ` David Rientjes
2010-10-15  9:09       ` David Rientjes
2010-10-21 14:56         ` Christoph Lameter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox