public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 3/5] mm: create __alloc_bootmem_low_nopanic
@ 2006-05-09 23:59 Jon Mason
  0 siblings, 0 replies; only message in thread
From: Jon Mason @ 2006-05-09 23:59 UTC (permalink / raw)
  To: linux-kernel; +Cc: ak, Luck, Tony, linux-ia64, mulix

Per Andi Kleen's suggestion in the review of our Calgary IOMMU code, I
tried to use the alloc_bootmem_nopanic when allocing bootmem.
Unfortunately, it needs low mem for our translation tables, so we needed
a new function to do this.

I have updated swiotlb to take advantage of this new function in the
patch following this one.

This patch has been tested individually and cumulatively on x86_64 and
cross-compile tested on IA64.  Since I have no IA64 hardware, any
testing on that platform would be appreciated.

Thanks,
Jon

Signed-off-by: Jon Mason <jdmason@us.ibm.com>

diff -r 235bc05ff8b1 -r 9459ba92585b include/linux/bootmem.h
--- a/include/linux/bootmem.h	Mon May  8 16:17:49 2006
+++ b/include/linux/bootmem.h	Mon May  8 16:30:29 2006
@@ -54,6 +54,9 @@
 extern void * __init __alloc_bootmem_low(unsigned long size,
 					 unsigned long align,
 					 unsigned long goal);
+extern void * __init __alloc_bootmem_low_nopanic(unsigned long size,
+						 unsigned long align,
+						 unsigned long goal);
 extern void * __init __alloc_bootmem_low_node(pg_data_t *pgdat,
 					      unsigned long size,
 					      unsigned long align,
diff -r 235bc05ff8b1 -r 9459ba92585b mm/bootmem.c
--- a/mm/bootmem.c	Mon May  8 16:17:49 2006
+++ b/mm/bootmem.c	Mon May  8 16:30:29 2006
@@ -473,3 +473,16 @@
 {
 	return __alloc_bootmem_core(pgdat->bdata, size, align, goal, LOW32LIMIT);
 }
+
+void * __init __alloc_bootmem_low_nopanic(unsigned long size,
+		unsigned long align, unsigned long goal)
+{
+	bootmem_data_t *bdata;
+	void *ptr;
+
+	list_for_each_entry(bdata, &bdata_list, list)
+		if ((ptr = __alloc_bootmem_core(bdata, size, align, goal,
+						LOW32LIMIT)))
+			return ptr;
+	return NULL;
+}

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-05-10  0:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-05-09 23:59 [PATCH 3/5] mm: create __alloc_bootmem_low_nopanic Jon Mason

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