public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] gurantee DMA area for alloc_bootmem_low()
@ 2005-07-12  6:50 Yasunori Goto
  2005-07-12 14:39 ` Martin J. Bligh
                   ` (2 more replies)
  0 siblings, 3 replies; 24+ messages in thread
From: Yasunori Goto @ 2005-07-12  6:50 UTC (permalink / raw)
  To: linux-mm; +Cc: Luck, Tony, linux-ia64, Martin J. Bligh

Hello.

This is a patch to guarantee that alloc_bootmem_low() allocate DMA area.

Current alloc_bootmem_low() is just specify "goal=0". And it is 
used for __alloc_bootmem_core() to decide which address is better.
However, there is no guarantee that __alloc_bootmem_core()
allocate DMA area when goal=0 is specified.
Even if there is no DMA'ble area in searching node, it allocates
higher address than MAX_DMA_ADDRESS.

__alloc_bootmem_core() is called by order of for_each_pgdat()
in __alloc_bootmem(). So, if first node (node_id = 0) has
DMA'ble area, no trouble will occur. However, our new Itanium2 server
can change which node has lower address. And panic really occurred on it.
The message was "bounce buffer is not DMA'ble" in swiothl_map_single().

To avoid this panic, following patch skips no DMA'ble node when 
lower address is required.
I tested this patch on my Tiger 4 and our new server.

Please apply.

Thanks.

Signed-off by Yasunori Goto <y-goto@jp.fujitsu.com>

Index: allocbootmem/mm/bootmem.c
=================================--- allocbootmem.orig/mm/bootmem.c	2005-06-30 11:57:13.000000000 +0900
+++ allocbootmem/mm/bootmem.c	2005-07-08 20:46:56.209040741 +0900
@@ -387,10 +387,16 @@
 	pg_data_t *pgdat = pgdat_list;
 	void *ptr;
 
-	for_each_pgdat(pgdat)
+	for_each_pgdat(pgdat){
+
+		if (goal < __pa(MAX_DMA_ADDRESS) &&
+		    pgdat->bdata->node_boot_start >= __pa(MAX_DMA_ADDRESS))
+			continue; /* Skip No DMA node */
+
 		if ((ptr = __alloc_bootmem_core(pgdat->bdata, size,
 						align, goal)))
 			return(ptr);
+	}
 
 	/*
 	 * Whoops, we cannot satisfy the allocation request.

-- 
Yasunori Goto 


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

end of thread, other threads:[~2005-08-19  3:03 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-07-12  6:50 [PATCH] gurantee DMA area for alloc_bootmem_low() Yasunori Goto
2005-07-12 14:39 ` Martin J. Bligh
2005-07-13  5:09   ` Yasunori Goto
2005-07-12 18:30 ` Mike Kravetz
2005-07-12 19:29   ` Dave Hansen
2005-07-12 20:37     ` Mike Kravetz
2005-07-13  6:34   ` Yasunori Goto
2005-07-13 22:03     ` Mike Kravetz
2005-07-15  2:43       ` Yasunori Goto
2005-08-09 11:11 ` [PATCH] gurantee DMA area for alloc_bootmem_low() ver. 2 Yasunori Goto
2005-08-09 15:05   ` Martin J. Bligh
2005-08-09 21:15   ` Mike Kravetz
2005-08-10  3:06     ` Dave Hansen
2005-08-10 16:23       ` Dave Hansen
2005-08-11 20:46     ` Christoph Lameter
2005-08-11 21:14       ` Mike Kravetz
2005-08-11 22:37         ` Christoph Lameter
2005-08-09 23:02   ` Peter Chubb
2005-08-10  6:10     ` Yasunori Goto
2005-08-18 19:52       ` Andrew Morton
2005-08-18 21:39         ` Andi Kleen
2005-08-19  2:29           ` Yasunori Goto
2005-08-19  3:03             ` Andi Kleen
2005-08-19  1:26         ` Yasunori Goto

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