All of lore.kernel.org
 help / color / mirror / Atom feed
* - bootmem-avoid-dma32-zone-by-default.patch removed from -mm tree
@ 2010-03-09 19:40 akpm
       [not found] ` <4B96B923.7020805@kernel.org>
  0 siblings, 1 reply; 7+ messages in thread
From: akpm @ 2010-03-09 19:40 UTC (permalink / raw)
  To: hannes, hpa, jslaby, mingo, ralf, stable, tglx, yinghai,
	mm-commits


The patch titled
     bootmem: avoid DMA32 zone by default
has been removed from the -mm tree.  Its filename was
     bootmem-avoid-dma32-zone-by-default.patch

This patch was dropped because I'm all confused

The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/

------------------------------------------------------
Subject: bootmem: avoid DMA32 zone by default
From: Johannes Weiner <hannes@cmpxchg.org>

Bootmem already tries normal allocations above the DMA zone to reserve it
for users that can not cope with higher addresses.

The same principle applies to the DMA32 zone, which is currently not
spared from normal allocations.

This can lead to exhaustion of this limited amount of address space
through things that can easily live elsewhere, like the mem_map e.g.

Raise bootmem's default goal beyond DMA32 for architectures with this zone
defined.  For now, these are x86 and mips.

I cc'd stable because this affects already released kernels.  But since
this is the first report of DMA32 memory exhaustion through bootmem that I
hear of, you guys might want to skip this patch due to the fragile nature
of early memory management.

Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
Reported-by: Jiri Slaby <jslaby@suse.cz>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Ingo Molnar <mingo@elte.hu>
Cc Thomas Gleixner <tglx@linutronix.de>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Yinghai Lu <yinghai@kernel.org>
Cc: <stable@kernel.org>		[See above note]
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 include/linux/bootmem.h |   20 +++++++++++++-------
 1 file changed, 13 insertions(+), 7 deletions(-)

diff -puN include/linux/bootmem.h~bootmem-avoid-dma32-zone-by-default include/linux/bootmem.h
--- a/include/linux/bootmem.h~bootmem-avoid-dma32-zone-by-default
+++ a/include/linux/bootmem.h
@@ -103,20 +103,26 @@ extern void *__alloc_bootmem_low_node(pg
 				      unsigned long align,
 				      unsigned long goal);
 
+#ifdef MAX_DMA32_PFN
+#define BOOTMEM_DEFAULT_GOAL	(MAX_DMA32_PFN << PAGE_SHIFT)
+#else
+#define BOOTMEM_DEFAULT_GOAL	__pa(MAX_DMA_ADDRESS)
+#endif
+
 #define alloc_bootmem(x) \
-	__alloc_bootmem(x, SMP_CACHE_BYTES, __pa(MAX_DMA_ADDRESS))
+	__alloc_bootmem(x, SMP_CACHE_BYTES, BOOTMEM_DEFAULT_GOAL)
 #define alloc_bootmem_nopanic(x) \
-	__alloc_bootmem_nopanic(x, SMP_CACHE_BYTES, __pa(MAX_DMA_ADDRESS))
+	__alloc_bootmem_nopanic(x, SMP_CACHE_BYTES, BOOTMEM_DEFAULT_GOAL)
 #define alloc_bootmem_pages(x) \
-	__alloc_bootmem(x, PAGE_SIZE, __pa(MAX_DMA_ADDRESS))
+	__alloc_bootmem(x, PAGE_SIZE, BOOTMEM_DEFAULT_GOAL)
 #define alloc_bootmem_pages_nopanic(x) \
-	__alloc_bootmem_nopanic(x, PAGE_SIZE, __pa(MAX_DMA_ADDRESS))
+	__alloc_bootmem_nopanic(x, PAGE_SIZE, BOOTMEM_DEFAULT_GOAL)
 #define alloc_bootmem_node(pgdat, x) \
-	__alloc_bootmem_node(pgdat, x, SMP_CACHE_BYTES, __pa(MAX_DMA_ADDRESS))
+	__alloc_bootmem_node(pgdat, x, SMP_CACHE_BYTES, BOOTMEM_DEFAULT_GOAL)
 #define alloc_bootmem_pages_node(pgdat, x) \
-	__alloc_bootmem_node(pgdat, x, PAGE_SIZE, __pa(MAX_DMA_ADDRESS))
+	__alloc_bootmem_node(pgdat, x, PAGE_SIZE, BOOTMEM_DEFAULT_GOAL)
 #define alloc_bootmem_pages_node_nopanic(pgdat, x) \
-	__alloc_bootmem_node_nopanic(pgdat, x, PAGE_SIZE, __pa(MAX_DMA_ADDRESS))
+	__alloc_bootmem_node_nopanic(pgdat, x, PAGE_SIZE, BOOTMEM_DEFAULT_GOAL)
 
 #define alloc_bootmem_low(x) \
 	__alloc_bootmem_low(x, SMP_CACHE_BYTES, 0)
_

Patches currently in -mm which might be from hannes@cmpxchg.org are

bootmem-avoid-dma32-zone-by-default.patch


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

end of thread, other threads:[~2010-03-10  7:16 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-09 19:40 - bootmem-avoid-dma32-zone-by-default.patch removed from -mm tree akpm
     [not found] ` <4B96B923.7020805@kernel.org>
     [not found]   ` <20100309134902.171ba2ae.akpm@linux-foundation.org>
2010-03-10  0:01     ` further plans on bootmem, was: " Johannes Weiner
2010-03-10  0:01       ` Johannes Weiner
2010-03-10  0:06       ` Yinghai Lu
2010-03-10  0:06         ` Yinghai Lu
2010-03-10  7:16       ` David Miller
2010-03-10  7:16         ` David Miller

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.