Skip to content

Commit

Permalink
[PATCH] enable booting a NUMA system where some nodes have no memory
Browse files Browse the repository at this point in the history
When booting a NUMA system with nodes that have no memory (eg by limiting
memory), bootmem_alloc_core tried to find pages in an uninitialized
bootmem_map.  This caused a null pointer access.  This fix adds a check, so
that NULL is returned.  That will enable the caller (bootmem_alloc_nopanic)
to alloc memory on other without a panic.

Signed-off-by: Christian Krafft <krafft@de.ibm.com>
Cc: Christoph Lameter <clameter@engr.sgi.com>
Cc: Andy Whitcroft <apw@shadowen.org>
Cc: Martin Bligh <mbligh@google.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Christian Krafft authored and Linus Torvalds committed Dec 7, 2006
1 parent a120586 commit 7c309a6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions mm/bootmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,10 @@ __alloc_bootmem_core(struct bootmem_data *bdata, unsigned long size,
if (limit && bdata->node_boot_start >= limit)
return NULL;

/* on nodes without memory - bootmem_map is NULL */
if (!bdata->node_bootmem_map)
return NULL;

end_pfn = bdata->node_low_pfn;
limit = PFN_DOWN(limit);
if (limit && end_pfn > limit)
Expand Down

0 comments on commit 7c309a6

Please sign in to comment.