aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/mm/mem.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/mm/mem.c')
-rw-r--r--arch/powerpc/mm/mem.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c
index 550517c2dd42..741dd8802d49 100644
--- a/arch/powerpc/mm/mem.c
+++ b/arch/powerpc/mm/mem.c
@@ -108,8 +108,8 @@ EXPORT_SYMBOL(phys_mem_access_prot);
108void online_page(struct page *page) 108void online_page(struct page *page)
109{ 109{
110 ClearPageReserved(page); 110 ClearPageReserved(page);
111 set_page_count(page, 0); 111 init_page_count(page);
112 free_cold_page(page); 112 __free_page(page);
113 totalram_pages++; 113 totalram_pages++;
114 num_physpages++; 114 num_physpages++;
115} 115}
@@ -125,7 +125,7 @@ int __devinit add_memory(u64 start, u64 size)
125 nid = hot_add_scn_to_nid(start); 125 nid = hot_add_scn_to_nid(start);
126 pgdata = NODE_DATA(nid); 126 pgdata = NODE_DATA(nid);
127 127
128 start = __va(start); 128 start = (unsigned long)__va(start);
129 create_section_mapping(start, start + size); 129 create_section_mapping(start, start + size);
130 130
131 /* this should work for most non-highmem platforms */ 131 /* this should work for most non-highmem platforms */
@@ -195,7 +195,7 @@ void show_mem(void)
195 printk("Mem-info:\n"); 195 printk("Mem-info:\n");
196 show_free_areas(); 196 show_free_areas();
197 printk("Free swap: %6ldkB\n", nr_swap_pages<<(PAGE_SHIFT-10)); 197 printk("Free swap: %6ldkB\n", nr_swap_pages<<(PAGE_SHIFT-10));
198 for_each_pgdat(pgdat) { 198 for_each_online_pgdat(pgdat) {
199 unsigned long flags; 199 unsigned long flags;
200 pgdat_resize_lock(pgdat, &flags); 200 pgdat_resize_lock(pgdat, &flags);
201 for (i = 0; i < pgdat->node_spanned_pages; i++) { 201 for (i = 0; i < pgdat->node_spanned_pages; i++) {
@@ -249,7 +249,6 @@ void __init do_init_bootmem(void)
249 bootmap_pages = bootmem_bootmap_pages(total_pages); 249 bootmap_pages = bootmem_bootmap_pages(total_pages);
250 250
251 start = lmb_alloc(bootmap_pages << PAGE_SHIFT, PAGE_SIZE); 251 start = lmb_alloc(bootmap_pages << PAGE_SHIFT, PAGE_SIZE);
252 BUG_ON(!start);
253 252
254 boot_mapsize = init_bootmem(start >> PAGE_SHIFT, total_pages); 253 boot_mapsize = init_bootmem(start >> PAGE_SHIFT, total_pages);
255 254
@@ -343,7 +342,7 @@ void __init mem_init(void)
343#ifdef CONFIG_NEED_MULTIPLE_NODES 342#ifdef CONFIG_NEED_MULTIPLE_NODES
344 for_each_online_node(nid) { 343 for_each_online_node(nid) {
345 if (NODE_DATA(nid)->node_spanned_pages != 0) { 344 if (NODE_DATA(nid)->node_spanned_pages != 0) {
346 printk("freeing bootmem node %x\n", nid); 345 printk("freeing bootmem node %d\n", nid);
347 totalram_pages += 346 totalram_pages +=
348 free_all_bootmem_node(NODE_DATA(nid)); 347 free_all_bootmem_node(NODE_DATA(nid));
349 } 348 }
@@ -352,7 +351,7 @@ void __init mem_init(void)
352 max_mapnr = max_pfn; 351 max_mapnr = max_pfn;
353 totalram_pages += free_all_bootmem(); 352 totalram_pages += free_all_bootmem();
354#endif 353#endif
355 for_each_pgdat(pgdat) { 354 for_each_online_pgdat(pgdat) {
356 for (i = 0; i < pgdat->node_spanned_pages; i++) { 355 for (i = 0; i < pgdat->node_spanned_pages; i++) {
357 if (!pfn_valid(pgdat->node_start_pfn + i)) 356 if (!pfn_valid(pgdat->node_start_pfn + i))
358 continue; 357 continue;
@@ -376,7 +375,7 @@ void __init mem_init(void)
376 struct page *page = pfn_to_page(pfn); 375 struct page *page = pfn_to_page(pfn);
377 376
378 ClearPageReserved(page); 377 ClearPageReserved(page);
379 set_page_count(page, 1); 378 init_page_count(page);
380 __free_page(page); 379 __free_page(page);
381 totalhigh_pages++; 380 totalhigh_pages++;
382 } 381 }