summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/mm/numa.c
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@samba.org>2005-11-16 11:43:26 +1100
committerLinus Torvalds <torvalds@g5.osdl.org>2005-11-15 16:57:12 -0800
commitfb6d73d3014babb69f5cc2d1d78b31e9d09fc5df (patch)
tree9d8ee68b8754fc57948098945113871aee0b23bb /arch/powerpc/mm/numa.c
parent1e185b97b4364063f1135604b87f8d8469944233 (diff)
downloadblackbird-op-linux-fb6d73d3014babb69f5cc2d1d78b31e9d09fc5df.tar.gz
blackbird-op-linux-fb6d73d3014babb69f5cc2d1d78b31e9d09fc5df.zip
[PATCH] powerpc: Fix sparsemem with memory holes [was Re: ppc64 oops..]
This patch should fix the crashes we have been seeing on 64-bit powerpc systems with a memory hole when sparsemem is enabled. I'd appreciate it if people who know more about NUMA and sparsemem than me could look over it. There were two bugs. The first was that if NUMA was enabled but there was no NUMA information for the machine, the setup_nonnuma() function was adding a single region, assuming memory was contiguous. The second was that the loops in mem_init() and show_mem() assumed that all pages within the span of a pgdat were valid (had a valid struct page). I also fixed the incorrect setting of num_physpages that Mike Kravetz pointed out. Signed-off-by: Paul Mackerras <paulus@samba.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/powerpc/mm/numa.c')
-rw-r--r--arch/powerpc/mm/numa.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c
index bd2cf1336885..f72cf87364cb 100644
--- a/arch/powerpc/mm/numa.c
+++ b/arch/powerpc/mm/numa.c
@@ -483,6 +483,7 @@ static void __init setup_nonnuma(void)
{
unsigned long top_of_ram = lmb_end_of_DRAM();
unsigned long total_ram = lmb_phys_mem_size();
+ unsigned int i;
printk(KERN_INFO "Top of RAM: 0x%lx, Total RAM: 0x%lx\n",
top_of_ram, total_ram);
@@ -490,7 +491,9 @@ static void __init setup_nonnuma(void)
(top_of_ram - total_ram) >> 20);
map_cpu_to_node(boot_cpuid, 0);
- add_region(0, 0, lmb_end_of_DRAM() >> PAGE_SHIFT);
+ for (i = 0; i < lmb.memory.cnt; ++i)
+ add_region(0, lmb.memory.region[i].base >> PAGE_SHIFT,
+ lmb_size_pages(&lmb.memory, i));
node_set_online(0);
}
OpenPOWER on IntegriCloud