* [PATCH] __alloc_bootmem_node should not panic when it fails
@ 2004-06-27 5:27 Anton Blanchard
2004-06-27 6:27 ` Ingo Oeser
0 siblings, 1 reply; 6+ messages in thread
From: Anton Blanchard @ 2004-06-27 5:27 UTC (permalink / raw)
To: akpm; +Cc: linux-kernel, rusty
__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);
}
_
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH] __alloc_bootmem_node should not panic when it fails
2004-06-27 5:27 [PATCH] __alloc_bootmem_node should not panic when it fails Anton Blanchard
@ 2004-06-27 6:27 ` Ingo Oeser
2004-06-27 22:28 ` Anton Blanchard
0 siblings, 1 reply; 6+ messages in thread
From: Ingo Oeser @ 2004-06-27 6:27 UTC (permalink / raw)
To: linux-kernel; +Cc: Anton Blanchard, akpm, rusty
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Sunday 27 June 2004 07:27, Anton Blanchard wrote:
> 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.
But allocating from other nodes has performance implications, which
might be quite big, depending on the specific architecture. So you
should at least print an KERN_INFO or even KERN_WARNING message,
if this happens.
> 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);
Maybe changing this message to:
printk(KERN_WARNING "Failed to alloc %lu bytes from local node.\n"
" Allocating from distant node instead. Performance may drop!\n", size);
> - panic("Out of memory");
> - return NULL;
> + return __alloc_bootmem(size, align, goal);
> }
So now the user knows what is going on and that this node might need
more memory ;-)
Regards
Ingo Oeser
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
iD8DBQFA3mjOU56oYWuOrkARAuQGAJ9lasSDYLgMDzAGnGYxnH4OpSHXNQCg0uy3
12GFsxYaaptUIZkYHYUw9Is=
=1ydw
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH] __alloc_bootmem_node should not panic when it fails
2004-06-27 6:27 ` Ingo Oeser
@ 2004-06-27 22:28 ` Anton Blanchard
2004-06-28 6:29 ` Chris Wedgwood
0 siblings, 1 reply; 6+ messages in thread
From: Anton Blanchard @ 2004-06-27 22:28 UTC (permalink / raw)
To: Ingo Oeser; +Cc: linux-kernel, akpm, rusty
> But allocating from other nodes has performance implications, which
> might be quite big, depending on the specific architecture. So you
> should at least print an KERN_INFO or even KERN_WARNING message,
> if this happens.
...
> So now the user knows what is going on and that this node might need
> more memory ;-)
Unfortunately nodes without memory is relatively common on ppc64, and I
believe x86-64. From a ppc64 perspective Im fine with best effort, perhaps
someone from the heavily NUMA camp (ia64?) could comment.
Anton
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] __alloc_bootmem_node should not panic when it fails
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
0 siblings, 2 replies; 6+ messages in thread
From: Chris Wedgwood @ 2004-06-28 6:29 UTC (permalink / raw)
To: Anton Blanchard; +Cc: Ingo Oeser, linux-kernel, akpm, rusty
On Mon, Jun 28, 2004 at 08:28:03AM +1000, Anton Blanchard wrote:
> Unfortunately nodes without memory is relatively common on ppc64,
> and I believe x86-64. From a ppc64 perspective Im fine with best
> effort, perhaps someone from the heavily NUMA camp (ia64?) could
> comment.
Does anyone make ia64 NUMA hardware where you can have memory-less
nodes?
--cw
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] __alloc_bootmem_node should not panic when it fails
2004-06-28 6:29 ` Chris Wedgwood
@ 2004-06-28 12:04 ` Robert Picco
2004-06-28 18:26 ` Martin Hicks
1 sibling, 0 replies; 6+ messages in thread
From: Robert Picco @ 2004-06-28 12:04 UTC (permalink / raw)
To: Chris Wedgwood; +Cc: Anton Blanchard, Ingo Oeser, linux-kernel, akpm, rusty
Chris Wedgwood wrote:
>On Mon, Jun 28, 2004 at 08:28:03AM +1000, Anton Blanchard wrote:
>
>
>
>>Unfortunately nodes without memory is relatively common on ppc64,
>>and I believe x86-64. From a ppc64 perspective Im fine with best
>>effort, perhaps someone from the heavily NUMA camp (ia64?) could
>>comment.
>>
>>
>
>Does anyone make ia64 NUMA hardware where you can have memory-less
>nodes?
>
>
> --cw
>
>
>
HP ships IA64 NUMA hardware where the default memory configuration is
memory-less. There are N-1 cpu-nodes and 1 memory node.
Bob
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] __alloc_bootmem_node should not panic when it fails
2004-06-28 6:29 ` Chris Wedgwood
2004-06-28 12:04 ` Robert Picco
@ 2004-06-28 18:26 ` Martin Hicks
1 sibling, 0 replies; 6+ messages in thread
From: Martin Hicks @ 2004-06-28 18:26 UTC (permalink / raw)
To: Chris Wedgwood; +Cc: Anton Blanchard, Ingo Oeser, linux-kernel, akpm, rusty
On Sun, Jun 27, 2004 at 11:29:12PM -0700, Chris Wedgwood wrote:
> On Mon, Jun 28, 2004 at 08:28:03AM +1000, Anton Blanchard wrote:
>
> > Unfortunately nodes without memory is relatively common on ppc64,
> > and I believe x86-64. From a ppc64 perspective Im fine with best
> > effort, perhaps someone from the heavily NUMA camp (ia64?) could
> > comment.
>
> Does anyone make ia64 NUMA hardware where you can have memory-less
> nodes?
Altix SN2 can have memoryless nodes
mh
--
Martin Hicks Wild Open Source Inc.
mort@wildopensource.com 613-266-2296
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2004-06-28 18:26 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-06-27 5:27 [PATCH] __alloc_bootmem_node should not panic when it fails Anton Blanchard
2004-06-27 6:27 ` 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
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox