* [PATCH 5/6] Optional ZONE_DMA for x86_64
@ 2006-09-11 22:27 Christoph Lameter
2006-09-12 6:40 ` Andi Kleen
` (3 more replies)
0 siblings, 4 replies; 6+ messages in thread
From: Christoph Lameter @ 2006-09-11 22:27 UTC (permalink / raw)
To: linux-ia64
x86_64: optional ZONE_DMA/ZONE_DMA32
Allow the use to specify CONFIG_ZONE_DMA32 and CONFIG_ZONE_DMA (via
CONFIG_GENERIC_ISA_DMA).
If CONFIG_ZONE_DMA is off then devices requiring ISA DMA can no
longer be selected.
There are no drivers depending on CONFIG_ZONE_DMA32. If CONFIG_ZONE_DMA32
is not set then the system assumes that DMA devices are capable of
doing DMA to all of memory (which is mostly the case since most
x86_64 motherboards only allow a max of 4GB of memory and advanced
systems have DMA subsystems that handle I/O properly).
Signed-off-by: Christoph Lameter <clameter@sgi.com>
Index: linux-2.6.18-rc6-mm1/arch/x86_64/mm/init.c
=================================--- linux-2.6.18-rc6-mm1.orig/arch/x86_64/mm/init.c 2006-09-11 16:06:41.705747849 -0500
+++ linux-2.6.18-rc6-mm1/arch/x86_64/mm/init.c 2006-09-11 16:08:13.190088058 -0500
@@ -406,9 +406,15 @@
#ifndef CONFIG_NUMA
void __init paging_init(void)
{
- unsigned long max_zone_pfns[MAX_NR_ZONES] = {MAX_DMA_PFN,
- MAX_DMA32_PFN,
- end_pfn};
+ unsigned long max_zone_pfns[MAX_NR_ZONES] = {
+#ifdef CONFIG_ZONE_DMA
+ MAX_DMA_PFN,
+#endif
+#ifdef CONFIG_ZONE_DMA32
+ MAX_DMA32_PFN,
+#endif
+ end_pfn
+ };
memory_present(0, 0, end_pfn);
sparse_init();
free_area_init_nodes(max_zone_pfns);
Index: linux-2.6.18-rc6-mm1/arch/x86_64/Kconfig
=================================--- linux-2.6.18-rc6-mm1.orig/arch/x86_64/Kconfig 2006-09-11 16:06:41.713561013 -0500
+++ linux-2.6.18-rc6-mm1/arch/x86_64/Kconfig 2006-09-11 16:10:45.369039566 -0500
@@ -24,10 +24,6 @@
bool
default y
-config ZONE_DMA32
- bool
- default y
-
config LOCKDEP_SUPPORT
bool
default y
@@ -73,10 +69,6 @@
bool
default y
-config GENERIC_ISA_DMA
- bool
- default y
-
config GENERIC_IOMAP
bool
default y
@@ -251,6 +243,24 @@
See <file:Documentation/mtrr.txt> for more information.
+config ZONE_DMA32
+ bool "32 Bit DMA Zone (only needed if memory >4GB)"
+ default y
+ help
+ Some x64 configurations have 32 bit DMA controllers that cannot
+ write to all of memory. If you have one of these and you have RAM
+ beyond the 4GB boundary then enable this option.
+
+config GENERIC_ISA_DMA
+ bool "ISA DMA zone (to support ISA legacy DMA)"
+ default y
+ help
+ If DMA for ISA boards needs to be supported then this option
+ needs to be enabled. An additional DMA zone for <16MB memory
+ will be created and memory below 16MB will be used for those
+ devices. If this is deselected then devices that use ISA
+ DMA will not be selectable.
+
config SMP
bool "Symmetric multi-processing support"
---help---
@@ -611,6 +621,7 @@
# we have no ISA slots, but we do have ISA-style DMA.
config ISA_DMA_API
bool
+ depends on GENERIC_ISA_DMA
default y
config GENERIC_PENDING_IRQ
Index: linux-2.6.18-rc6-mm1/arch/x86_64/kernel/Makefile
=================================--- linux-2.6.18-rc6-mm1.orig/arch/x86_64/kernel/Makefile 2006-09-11 16:06:41.726257405 -0500
+++ linux-2.6.18-rc6-mm1/arch/x86_64/kernel/Makefile 2006-09-11 16:08:13.214504197 -0500
@@ -7,9 +7,10 @@
obj-y := process.o signal.o entry.o traps.o irq.o \
ptrace.o time.o ioport.o ldt.o setup.o i8259.o sys_x86_64.o \
x8664_ksyms.o i387.o syscall.o vsyscall.o \
- setup64.o bootflag.o e820.o reboot.o quirks.o i8237.o \
+ setup64.o bootflag.o e820.o reboot.o quirks.o \
pci-dma.o pci-nommu.o alternative.o early-quirks.o
+obj-$(CONFIG_GENERIC_ISA_DMA) += i8237.o
obj-$(CONFIG_STACKTRACE) += stacktrace.o
obj-$(CONFIG_X86_MCE) += mce.o
obj-$(CONFIG_X86_MCE_INTEL) += mce_intel.o
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH 5/6] Optional ZONE_DMA for x86_64
2006-09-11 22:27 [PATCH 5/6] Optional ZONE_DMA for x86_64 Christoph Lameter
@ 2006-09-12 6:40 ` Andi Kleen
2006-09-12 11:11 ` Andi Kleen
` (2 subsequent siblings)
3 siblings, 0 replies; 6+ messages in thread
From: Andi Kleen @ 2006-09-12 6:40 UTC (permalink / raw)
To: linux-ia64
On Tuesday 12 September 2006 00:27, Christoph Lameter wrote:
> x86_64: optional ZONE_DMA/ZONE_DMA32
>
> Allow the use to specify CONFIG_ZONE_DMA32 and CONFIG_ZONE_DMA (via
> CONFIG_GENERIC_ISA_DMA).
>
> If CONFIG_ZONE_DMA is off then devices requiring ISA DMA can no
> longer be selected.
>
> There are no drivers depending on CONFIG_ZONE_DMA32. If CONFIG_ZONE_DMA32
> is not set then the system assumes that DMA devices are capable of
> doing DMA to all of memory (which is mostly the case since most
> x86_64 motherboards only allow a max of 4GB of memory and advanced
> systems have DMA subsystems that handle I/O properly).
Pretty much all have this problem (or do you know of a system with no
USB controller?)
I think I would prefer to not make GFP_DMA32 optional.
Adding a 4GB limit CONFIG to a 64bit kernel just seems somewhat
dumb.
Also what happens when someone still sets GFP_DMA?
iirc the SCSI stack tended to do that for some structures.
Will it fail?
Making GFP_DMA optional would be an interesting
experiment (I think it will break the floppies but other than that
a modern system might be fine). But it would be better
to warn the user stronger against it (most likely it will still
break a lot of older addin cards) and tell them about
the floppy.
BTW we still call it x86-64, not x64.
-Andi
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH 5/6] Optional ZONE_DMA for x86_64
2006-09-11 22:27 [PATCH 5/6] Optional ZONE_DMA for x86_64 Christoph Lameter
2006-09-12 6:40 ` Andi Kleen
@ 2006-09-12 11:11 ` Andi Kleen
2006-09-12 11:40 ` Matthew Wilcox
2006-09-12 17:28 ` Christoph Lameter
3 siblings, 0 replies; 6+ messages in thread
From: Andi Kleen @ 2006-09-12 11:11 UTC (permalink / raw)
To: linux-ia64
On Tuesday 12 September 2006 13:40, Matthew Wilcox wrote:
> On Tue, Sep 12, 2006 at 08:40:22AM +0200, Andi Kleen wrote:
> > I think I would prefer to not make GFP_DMA32 optional.
> > Adding a 4GB limit CONFIG to a 64bit kernel just seems somewhat
> > dumb.
>
> Hmm? I would think that the majority of x86-64 users have <4GB.
Yes still it feels dumb, especially for something which you're unlikely
to benchmark a difference of.
> I bought an ASUS P5RD1-VM motherboard a few months ago which
> has 2 DIMM slots. Look at their list of 'hot' motherboards:
> http://usa.asus.com/products2.aspx?l1=3&l2\x11 I don't see a single one
> with more than 4 slots. 2GB DIMMs are hovering around the $400 mark;
> I'm not convinced that your average user is spending $1200 on RAM at
> this point.
4GB of RAM already gives you memory above the 32bit mark because
the PCI hole needs some below 4GB. The RAM below it is moved up.
So you need >4GB support even on the lowend boards when you
plug in 2x 2GB.
-Andi
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 5/6] Optional ZONE_DMA for x86_64
2006-09-11 22:27 [PATCH 5/6] Optional ZONE_DMA for x86_64 Christoph Lameter
2006-09-12 6:40 ` Andi Kleen
2006-09-12 11:11 ` Andi Kleen
@ 2006-09-12 11:40 ` Matthew Wilcox
2006-09-12 17:28 ` Christoph Lameter
3 siblings, 0 replies; 6+ messages in thread
From: Matthew Wilcox @ 2006-09-12 11:40 UTC (permalink / raw)
To: linux-ia64
On Tue, Sep 12, 2006 at 08:40:22AM +0200, Andi Kleen wrote:
> I think I would prefer to not make GFP_DMA32 optional.
> Adding a 4GB limit CONFIG to a 64bit kernel just seems somewhat
> dumb.
Hmm? I would think that the majority of x86-64 users have <4GB.
I bought an ASUS P5RD1-VM motherboard a few months ago which
has 2 DIMM slots. Look at their list of 'hot' motherboards:
http://usa.asus.com/products2.aspx?l1=3&l2\x11 I don't see a single one
with more than 4 slots. 2GB DIMMs are hovering around the $400 mark;
I'm not convinced that your average user is spending $1200 on RAM at
this point.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 5/6] Optional ZONE_DMA for x86_64
2006-09-11 22:27 [PATCH 5/6] Optional ZONE_DMA for x86_64 Christoph Lameter
` (2 preceding siblings ...)
2006-09-12 11:40 ` Matthew Wilcox
@ 2006-09-12 17:28 ` Christoph Lameter
3 siblings, 0 replies; 6+ messages in thread
From: Christoph Lameter @ 2006-09-12 17:28 UTC (permalink / raw)
To: linux-ia64
On Tue, 12 Sep 2006, Andi Kleen wrote:
> > There are no drivers depending on CONFIG_ZONE_DMA32. If CONFIG_ZONE_DMA32
> > is not set then the system assumes that DMA devices are capable of
> > doing DMA to all of memory (which is mostly the case since most
> > x86_64 motherboards only allow a max of 4GB of memory and advanced
> > systems have DMA subsystems that handle I/O properly).
>
> Pretty much all have this problem (or do you know of a system with no
> USB controller?)
Most motherboards do not support more than 4GB ram.
> I think I would prefer to not make GFP_DMA32 optional.
> Adding a 4GB limit CONFIG to a 64bit kernel just seems somewhat
> dumb.
So is delivering motherboards for 64 bit with 4GB Ram.
> Also what happens when someone still sets GFP_DMA?
> iirc the SCSI stack tended to do that for some structures.
> Will it fail?
No it will be ignored.
> Making GFP_DMA optional would be an interesting
> experiment (I think it will break the floppies but other than that
> a modern system might be fine). But it would be better
Right some drivers are not available anymore that includes the floppy
driver.
> to warn the user stronger against it (most likely it will still
> break a lot of older addin cards) and tell them about
> the floppy.
I still have some dusty set of floppies in my attic. Tried to use floppy a
year to boot but it was such a hassle that I fell back to a usb stick.
You can still have your floppies. Just do not disable support for
ZONE_DMA. Its enabled by default.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 0/8] Optional ZONE_DMA V1
@ 2006-09-11 22:30 Christoph Lameter
2006-09-11 22:30 ` [PATCH 5/6] Optional ZONE_DMA for x86_64 Christoph Lameter
0 siblings, 1 reply; 6+ messages in thread
From: Christoph Lameter @ 2006-09-11 22:30 UTC (permalink / raw)
To: linux-mm; +Cc: Christoph Lameter
Optional ZONE_DMA
This patch follows up on the earlier work in Andrew's tree to reduce
the number of zones. The patches allow to go to a minimum of 2 zones.
This one allows also to make ZONE_DMA optional and therefore the
number of zones can be reduced to one.
ZONE_DMA is usually used for ISA DMA devices. Typically modern hardware
does not have any of these anymore. So we frequently do not need
the zone anymore. The presence of an additional zone unnecessarily
complicates VM operations. It must be scanned and balancing logic
must operate in it etc etc. If one has a 1-1 correspondence between
zones and nodes in a NUMA system then various other optimizations
become possible.
Many systems today (especially 64 bit but also 32 bit machines with less
than 4G of memory) can therefore operate just fine with a single zone.
With a single zone various loops can be optimized away by the
compiler. Many system currently do not place anything in ZONE_DMA. On
most of my systems ZONE_DMA is completely empty. Why constantly look
at an empty zone in /proc/zoneinfo and empty slab in /proc/slabinfo?
Non i386 also frequently have no need for ZONE_DMA and zones stay
empty.
The patchset was tested on i386 (UP / SMP), x86_64 (UP, NUMA) and
ia64 (NUMA).
The RFC posted earlier (see
http://marc.theaimsgroup.com/?l=linux-kernel&m=115231723513008&w=2)
had lots of #ifdefs in them. An effort has been made to minize the number
of #ifdefs and make this as compact as possible. The job was made much easier
by the ongoing efforts of others to extract common arch specific functionality.
I have been running this for awhile now on my desktop and finally Linux is
using all my available RAM instead of leaving the 16MB in ZONE_DMA untouched:
christoph@pentium940:~$ cat /proc/zoneinfo
Node 0, zone Normal
pages free 4435
min 1448
low 1810
high 2172
active 241786
inactive 210170
scanned 0 (a: 0 i: 0)
spanned 524224
present 524224
nr_anon_pages 61680
nr_mapped 14271
nr_file_pages 390264
nr_slab_reclaimable 27564
nr_slab_unreclaimable 1793
nr_page_table_pages 449
nr_dirty 39
nr_writeback 0
nr_unstable 0
nr_bounce 0
cpu: 0 pcp: 0
count: 156
high: 186
batch: 31
cpu: 0 pcp: 1
count: 9
high: 62
batch: 15
vm stats threshold: 20
cpu: 1 pcp: 0
count: 177
high: 186
batch: 31
cpu: 1 pcp: 1
count: 12
high: 62
batch: 15
vm stats threshold: 20
all_unreclaimable: 0
prev_priority: 12
temp_priority: 12
start_pfn: 0
--
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>
^ permalink raw reply [flat|nested] 6+ messages in thread* [PATCH 5/6] Optional ZONE_DMA for x86_64
2006-09-11 22:30 [PATCH 0/8] Optional ZONE_DMA V1 Christoph Lameter
@ 2006-09-11 22:30 ` Christoph Lameter
0 siblings, 0 replies; 6+ messages in thread
From: Christoph Lameter @ 2006-09-11 22:30 UTC (permalink / raw)
To: linux-mm; +Cc: Christoph Lameter
Allow the use to specify CONFIG_ZONE_DMA32 and CONFIG_ZONE_DMA (via
CONFIG_GENERIC_ISA_DMA).
If CONFIG_ZONE_DMA is off then devices requiring ISA DMA can no
longer be selected.
There are no drivers depending on CONFIG_ZONE_DMA32. If CONFIG_ZONE_DMA32
is not set then the system assumes that DMA devices are capable of
doing DMA to all of memory (which is mostly the case since most
x86_64 motherboards only allow a max of 4GB of memory and advanced
systems have DMA subsystems that handle I/O properly).
Signed-off-by: Christoph Lameter <clameter@sgi.com>
Index: linux-2.6.18-rc6-mm1/arch/x86_64/mm/init.c
===================================================================
--- linux-2.6.18-rc6-mm1.orig/arch/x86_64/mm/init.c 2006-09-11 16:06:41.705747849 -0500
+++ linux-2.6.18-rc6-mm1/arch/x86_64/mm/init.c 2006-09-11 16:08:13.190088058 -0500
@@ -406,9 +406,15 @@
#ifndef CONFIG_NUMA
void __init paging_init(void)
{
- unsigned long max_zone_pfns[MAX_NR_ZONES] = {MAX_DMA_PFN,
- MAX_DMA32_PFN,
- end_pfn};
+ unsigned long max_zone_pfns[MAX_NR_ZONES] = {
+#ifdef CONFIG_ZONE_DMA
+ MAX_DMA_PFN,
+#endif
+#ifdef CONFIG_ZONE_DMA32
+ MAX_DMA32_PFN,
+#endif
+ end_pfn
+ };
memory_present(0, 0, end_pfn);
sparse_init();
free_area_init_nodes(max_zone_pfns);
Index: linux-2.6.18-rc6-mm1/arch/x86_64/Kconfig
===================================================================
--- linux-2.6.18-rc6-mm1.orig/arch/x86_64/Kconfig 2006-09-11 16:06:41.713561013 -0500
+++ linux-2.6.18-rc6-mm1/arch/x86_64/Kconfig 2006-09-11 16:10:45.369039566 -0500
@@ -24,10 +24,6 @@
bool
default y
-config ZONE_DMA32
- bool
- default y
-
config LOCKDEP_SUPPORT
bool
default y
@@ -73,10 +69,6 @@
bool
default y
-config GENERIC_ISA_DMA
- bool
- default y
-
config GENERIC_IOMAP
bool
default y
@@ -251,6 +243,24 @@
See <file:Documentation/mtrr.txt> for more information.
+config ZONE_DMA32
+ bool "32 Bit DMA Zone (only needed if memory >4GB)"
+ default y
+ help
+ Some x64 configurations have 32 bit DMA controllers that cannot
+ write to all of memory. If you have one of these and you have RAM
+ beyond the 4GB boundary then enable this option.
+
+config GENERIC_ISA_DMA
+ bool "ISA DMA zone (to support ISA legacy DMA)"
+ default y
+ help
+ If DMA for ISA boards needs to be supported then this option
+ needs to be enabled. An additional DMA zone for <16MB memory
+ will be created and memory below 16MB will be used for those
+ devices. If this is deselected then devices that use ISA
+ DMA will not be selectable.
+
config SMP
bool "Symmetric multi-processing support"
---help---
@@ -611,6 +621,7 @@
# we have no ISA slots, but we do have ISA-style DMA.
config ISA_DMA_API
bool
+ depends on GENERIC_ISA_DMA
default y
config GENERIC_PENDING_IRQ
Index: linux-2.6.18-rc6-mm1/arch/x86_64/kernel/Makefile
===================================================================
--- linux-2.6.18-rc6-mm1.orig/arch/x86_64/kernel/Makefile 2006-09-11 16:06:41.726257405 -0500
+++ linux-2.6.18-rc6-mm1/arch/x86_64/kernel/Makefile 2006-09-11 16:08:13.214504197 -0500
@@ -7,9 +7,10 @@
obj-y := process.o signal.o entry.o traps.o irq.o \
ptrace.o time.o ioport.o ldt.o setup.o i8259.o sys_x86_64.o \
x8664_ksyms.o i387.o syscall.o vsyscall.o \
- setup64.o bootflag.o e820.o reboot.o quirks.o i8237.o \
+ setup64.o bootflag.o e820.o reboot.o quirks.o \
pci-dma.o pci-nommu.o alternative.o early-quirks.o
+obj-$(CONFIG_GENERIC_ISA_DMA) += i8237.o
obj-$(CONFIG_STACKTRACE) += stacktrace.o
obj-$(CONFIG_X86_MCE) += mce.o
obj-$(CONFIG_X86_MCE_INTEL) += mce_intel.o
--
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>
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2006-09-12 17:28 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-09-11 22:27 [PATCH 5/6] Optional ZONE_DMA for x86_64 Christoph Lameter
2006-09-12 6:40 ` Andi Kleen
2006-09-12 11:11 ` Andi Kleen
2006-09-12 11:40 ` Matthew Wilcox
2006-09-12 17:28 ` Christoph Lameter
-- strict thread matches above, loose matches on Subject: below --
2006-09-11 22:30 [PATCH 0/8] Optional ZONE_DMA V1 Christoph Lameter
2006-09-11 22:30 ` [PATCH 5/6] Optional ZONE_DMA for x86_64 Christoph Lameter
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.