From: Anton Blanchard <anton@samba.org>
To: akpm@osdl.org
Cc: linux-kernel@vger.kernel.org, rusty@rustcorp.com.au
Subject: [PATCH] __alloc_bootmem_node should not panic when it fails
Date: Sun, 27 Jun 2004 15:27:47 +1000 [thread overview]
Message-ID: <20040627052747.GG23589@krispykreme> (raw)
__alloc_bootmem_node currently panics if it cant satisfy an allocation
for a particular node. Thats rather antisocial, we should at the very
least return NULL and allow the caller to proceed (eg try another node).
A quick look at alloc_bootmem_node usage suggests we should fall back to
allocating from other nodes if it fails (as arch/alpha/kernel/pci_iommu.c
and arch/x86_64/kernel/setup64.c do).
The following patch does that. We fall back to the regular
__alloc_bootmem when __alloc_bootmem_node fails, which means all other
nodes are checked for available memory.
Signed-off-by: Anton Blanchard <anton@samba.org>
diff -puN mm/bootmem.c~debugit mm/bootmem.c
--- gr_work/mm/bootmem.c~debugit 2004-06-06 21:49:20.729826223 -0500
+++ gr_work-anton/mm/bootmem.c 2004-06-06 22:07:16.840243987 -0500
@@ -371,11 +371,6 @@ void * __init __alloc_bootmem_node (pg_d
if (ptr)
return (ptr);
- /*
- * Whoops, we cannot satisfy the allocation request.
- */
- printk(KERN_ALERT "bootmem alloc of %lu bytes failed!\n", size);
- panic("Out of memory");
- return NULL;
+ return __alloc_bootmem(size, align, goal);
}
_
next reply other threads:[~2004-06-27 5:32 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-06-27 5:27 Anton Blanchard [this message]
2004-06-27 6:27 ` [PATCH] __alloc_bootmem_node should not panic when it fails Ingo Oeser
2004-06-27 22:28 ` Anton Blanchard
2004-06-28 6:29 ` Chris Wedgwood
2004-06-28 12:04 ` Robert Picco
2004-06-28 18:26 ` Martin Hicks
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=20040627052747.GG23589@krispykreme \
--to=anton@samba.org \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rusty@rustcorp.com.au \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox