diff options
author | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2007-01-16 09:01:47 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2007-01-24 06:59:56 -0500 |
commit | 204ecae4e10c235e6987cb7b2809a665511ab174 (patch) | |
tree | b111bf3069b748ab413e8b5c20b7ec71953a578a /arch/arm/mm/init.c | |
parent | 30f0e0f4153918a22d802b415980974514139389 (diff) |
[ARM] Fix show_mem() for discontigmem
show_mem() was assuming incorrectly that the mem_map for any
node started at PFN 0. This is obviously wrong; fix it to
take account of node_start_pfn.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mm/init.c')
-rw-r--r-- | arch/arm/mm/init.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c index b5814b4b6f35..7760193e74cc 100644 --- a/arch/arm/mm/init.c +++ b/arch/arm/mm/init.c | |||
@@ -52,15 +52,18 @@ void show_mem(void) | |||
52 | printk("Free swap: %6ldkB\n", nr_swap_pages<<(PAGE_SHIFT-10)); | 52 | printk("Free swap: %6ldkB\n", nr_swap_pages<<(PAGE_SHIFT-10)); |
53 | 53 | ||
54 | for_each_online_node(node) { | 54 | for_each_online_node(node) { |
55 | pg_data_t *n = NODE_DATA(node); | ||
56 | struct page *map = n->node_mem_map - n->node_start_pfn; | ||
57 | |||
55 | for_each_nodebank (i,mi,node) { | 58 | for_each_nodebank (i,mi,node) { |
56 | unsigned int pfn1, pfn2; | 59 | unsigned int pfn1, pfn2; |
57 | struct page *page, *end; | 60 | struct page *page, *end; |
58 | 61 | ||
59 | pfn1 = mi->bank[i].start >> PAGE_SHIFT; | 62 | pfn1 = __phys_to_pfn(mi->bank[i].start); |
60 | pfn2 = (mi->bank[i].size + mi->bank[i].start) >> PAGE_SHIFT; | 63 | pfn2 = __phys_to_pfn(mi->bank[i].size + mi->bank[i].start); |
61 | 64 | ||
62 | page = NODE_MEM_MAP(node) + pfn1; | 65 | page = map + pfn1; |
63 | end = NODE_MEM_MAP(node) + pfn2; | 66 | end = map + pfn2; |
64 | 67 | ||
65 | do { | 68 | do { |
66 | total++; | 69 | total++; |