linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Marcelo Tosatti <marcelo@kvack.org>
To: linux-mm@kvack.org, linux-kernel@vger.kernel.org, olpc-devel@laptop.org
Subject: [PATCH] introduce config option to disable DMA zone on i386
Date: Thu, 28 Dec 2006 15:03:02 -0200	[thread overview]
Message-ID: <20061228170302.GA4335@dmt> (raw)

Hi,

The following patch adds a config option to get rid of the DMA zone on i386.

Architectures with devices that have no addressing limitations (eg. PPC)
already work this way.

This is useful for custom kernel builds where the developer is certain that 
there are no address limitations.

For example, the OLPC machine contains:

- USB devices
- no floppy
- no address limited PCI devices
- no floppy

A unified zone simplifies VM reclaiming work, and also simplifies OOM
killer heuristics (no need to deal with OOM on the DMA zone).

Comments?

diff --git a/arch/i386/Kconfig b/arch/i386/Kconfig
index 0d67a0a..8d4dd5e 100644
--- a/arch/i386/Kconfig
+++ b/arch/i386/Kconfig
@@ -547,6 +547,18 @@ choice
 		bool "1G/3G user/kernel split"
 endchoice
 
+config NO_DMA_ZONE
+	bool "DMA zone support"
+	default n
+	help
+	 This disables support for the 16MiB DMA zone. Only enable this 
+	 option if you are certain that your devices contain no DMA
+	 addressing limitations. A few of them which do: 
+	 	- floppy
+	 	- ISA devices
+	 	- some PCI devices (soundcards, etc)
+
+
 config PAGE_OFFSET
 	hex
 	default 0xB0000000 if VMSPLIT_3G_OPT
diff --git a/arch/i386/kernel/setup.c b/arch/i386/kernel/setup.c
index 79df6e6..3078019 100644
--- a/arch/i386/kernel/setup.c
+++ b/arch/i386/kernel/setup.c
@@ -371,9 +371,13 @@ void __init zone_sizes_init(void)
 {
 	unsigned long max_zone_pfns[MAX_NR_ZONES];
 	memset(max_zone_pfns, 0, sizeof(max_zone_pfns));
+#ifndef CONFIG_NO_DMA_ZONE
 	max_zone_pfns[ZONE_DMA] =
 		virt_to_phys((char *)MAX_DMA_ADDRESS) >> PAGE_SHIFT;
 	max_zone_pfns[ZONE_NORMAL] = max_low_pfn;
+#else
+	max_zone_pfns[ZONE_DMA] = max_low_pfn;
+#endif
 #ifdef CONFIG_HIGHMEM
 	max_zone_pfns[ZONE_HIGHMEM] = highend_pfn;
 	add_active_range(0, 0, highend_pfn);

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

             reply	other threads:[~2006-12-28 17:03 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-28 17:03 Marcelo Tosatti [this message]
2006-12-28 17:30 ` Paul Mundt
2006-12-28 17:43 ` Arjan van de Ven
2006-12-28 18:36 ` Jan Engelhardt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20061228170302.GA4335@dmt \
    --to=marcelo@kvack.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=olpc-devel@laptop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox