All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jan Beulich" <jbeulich@novell.com>
To: <linux-kernel@vger.kernel.org>
Cc: <dhowells@redhat.com>
Subject: [PATCH] use no-panic variant of alloc_bootmem() in alloc_large_system_hash()
Date: Mon, 04 Aug 2008 14:35:45 +0100	[thread overview]
Message-ID: <489721D1.76E4.0078.0@novell.com> (raw)

.. since a failed allocation is being (initially) handled gracefully,
and panic()-ed upon failure explicitly in the function if retries with
smaller sizes failed.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Cc: David Howells <dhowells@redhat.com>

---
 include/linux/bootmem.h |    4 ++++
 mm/page_alloc.c         |    2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)

--- linux-2.6.27-rc1/include/linux/bootmem.h	2008-07-31 17:08:35.000000000 +0200
+++ 2.6.27-rc1-alloc-large-system-hash/include/linux/bootmem.h	2008-07-31 17:56:18.000000000 +0200
@@ -97,10 +97,14 @@ extern void *__alloc_bootmem_low_node(pg
 #ifndef CONFIG_HAVE_ARCH_BOOTMEM_NODE
 #define alloc_bootmem(x) \
 	__alloc_bootmem(x, SMP_CACHE_BYTES, __pa(MAX_DMA_ADDRESS))
+#define alloc_bootmem_nopanic(x) \
+	__alloc_bootmem_nopanic(x, SMP_CACHE_BYTES, __pa(MAX_DMA_ADDRESS))
 #define alloc_bootmem_low(x) \
 	__alloc_bootmem_low(x, SMP_CACHE_BYTES, 0)
 #define alloc_bootmem_pages(x) \
 	__alloc_bootmem(x, PAGE_SIZE, __pa(MAX_DMA_ADDRESS))
+#define alloc_bootmem_pages_nopanic(x) \
+	__alloc_bootmem_nopanic(x, PAGE_SIZE, __pa(MAX_DMA_ADDRESS))
 #define alloc_bootmem_low_pages(x) \
 	__alloc_bootmem_low(x, PAGE_SIZE, 0)
 #define alloc_bootmem_node(pgdat, x) \
--- linux-2.6.27-rc1/mm/page_alloc.c	2008-07-31 17:08:36.000000000 +0200
+++ 2.6.27-rc1-alloc-large-system-hash/mm/page_alloc.c	2008-07-31 17:56:37.000000000 +0200
@@ -4454,7 +4454,7 @@ void *__init alloc_large_system_hash(con
 	do {
 		size = bucketsize << log2qty;
 		if (flags & HASH_EARLY)
-			table = alloc_bootmem(size);
+			table = alloc_bootmem_nopanic(size);
 		else if (hashdist)
 			table = __vmalloc(size, GFP_ATOMIC, PAGE_KERNEL);
 		else {




             reply	other threads:[~2008-08-04 13:35 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-04 13:35 Jan Beulich [this message]
2008-08-13  8:17 ` [PATCH] Propagate new nonpanic bootmem macros to CONFIG_HAVE_ARCH_BOOTMEM_NODE Johannes Weiner
2008-08-13  8:30   ` Jan Beulich
2008-08-13  8:55     ` Ingo Molnar
2008-08-13  9:07       ` Johannes Weiner
2008-08-13  9:17         ` Ingo Molnar
2008-08-13  8:48   ` Ingo Molnar

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=489721D1.76E4.0078.0@novell.com \
    --to=jbeulich@novell.com \
    --cc=dhowells@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    /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.