All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jon Mason <jdmason@us.ibm.com>
To: linux-kernel@vger.kernel.org
Cc: ak@suse.de, "Luck, Tony" <tony.luck@intel.com>,
	linux-ia64@vger.kernel.org, mulix@mulix.org
Subject: [PATCH 3/5] mm: create __alloc_bootmem_low_nopanic
Date: Tue, 09 May 2006 23:59:46 +0000	[thread overview]
Message-ID: <20060509235946.GG22385@us.ibm.com> (raw)

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;
+}

WARNING: multiple messages have this Message-ID (diff)
From: Jon Mason <jdmason@us.ibm.com>
To: linux-kernel@vger.kernel.org
Cc: ak@suse.de, "Luck, Tony" <tony.luck@intel.com>,
	linux-ia64@vger.kernel.org, mulix@mulix.org
Subject: [PATCH 3/5] mm: create __alloc_bootmem_low_nopanic
Date: Tue, 9 May 2006 18:59:46 -0500	[thread overview]
Message-ID: <20060509235946.GG22385@us.ibm.com> (raw)

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;
+}

             reply	other threads:[~2006-05-09 23:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-09 23:59 Jon Mason [this message]
2006-05-09 23:59 ` [PATCH 3/5] mm: create __alloc_bootmem_low_nopanic Jon Mason

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=20060509235946.GG22385@us.ibm.com \
    --to=jdmason@us.ibm.com \
    --cc=ak@suse.de \
    --cc=linux-ia64@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mulix@mulix.org \
    --cc=tony.luck@intel.com \
    /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 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.