aboutsummaryrefslogtreecommitdiffstats
path: root/arch/parisc
diff options
context:
space:
mode:
authorJiang Liu <liuj97@gmail.com>2013-07-03 18:04:07 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-07-03 19:07:37 -0400
commit7d2c7747086354f7889e8d577c537f9ad8985230 (patch)
treedf1d9b8786ff73d41fb3b012290e6ceb72708258 /arch/parisc
parent1173db12bf145a0d0c6a2716e861de2fafde0522 (diff)
mm/PARISC: prepare for removing num_physpages and simplify mem_init()
Prepare for removing num_physpages and simplify mem_init(). Signed-off-by: Jiang Liu <jiang.liu@huawei.com> Cc: "James E.J. Bottomley" <jejb@parisc-linux.org> Cc: Helge Deller <deller@gmx.de> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Michal Hocko <mhocko@suse.cz> Cc: David Rientjes <rientjes@google.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/parisc')
-rw-r--r--arch/parisc/mm/init.c47
1 files changed, 3 insertions, 44 deletions
diff --git a/arch/parisc/mm/init.c b/arch/parisc/mm/init.c
index d8aaaf06ede2..b4edc76c6f22 100644
--- a/arch/parisc/mm/init.c
+++ b/arch/parisc/mm/init.c
@@ -214,7 +214,6 @@ static void __init setup_bootmem(void)
214 mem_limit_func(); /* check for "mem=" argument */ 214 mem_limit_func(); /* check for "mem=" argument */
215 215
216 mem_max = 0; 216 mem_max = 0;
217 num_physpages = 0;
218 for (i = 0; i < npmem_ranges; i++) { 217 for (i = 0; i < npmem_ranges; i++) {
219 unsigned long rsize; 218 unsigned long rsize;
220 219
@@ -229,10 +228,8 @@ static void __init setup_bootmem(void)
229 npmem_ranges = i + 1; 228 npmem_ranges = i + 1;
230 mem_max = mem_limit; 229 mem_max = mem_limit;
231 } 230 }
232 num_physpages += pmem_ranges[i].pages;
233 break; 231 break;
234 } 232 }
235 num_physpages += pmem_ranges[i].pages;
236 mem_max += rsize; 233 mem_max += rsize;
237 } 234 }
238 235
@@ -532,7 +529,7 @@ void free_initmem(void)
532 * pages are no-longer executable */ 529 * pages are no-longer executable */
533 flush_icache_range(init_begin, init_end); 530 flush_icache_range(init_begin, init_end);
534 531
535 num_physpages += free_initmem_default(-1); 532 free_initmem_default(-1);
536 533
537 /* set up a new led state on systems shipped LED State panel */ 534 /* set up a new led state on systems shipped LED State panel */
538 pdc_chassis_send_status(PDC_CHASSIS_DIRECT_BCOMPLETE); 535 pdc_chassis_send_status(PDC_CHASSIS_DIRECT_BCOMPLETE);
@@ -580,8 +577,6 @@ unsigned long pcxl_dma_start __read_mostly;
580 577
581void __init mem_init(void) 578void __init mem_init(void)
582{ 579{
583 int codesize, reservedpages, datasize, initsize;
584
585 /* Do sanity checks on page table constants */ 580 /* Do sanity checks on page table constants */
586 BUILD_BUG_ON(PTE_ENTRY_SIZE != sizeof(pte_t)); 581 BUILD_BUG_ON(PTE_ENTRY_SIZE != sizeof(pte_t));
587 BUILD_BUG_ON(PMD_ENTRY_SIZE != sizeof(pmd_t)); 582 BUILD_BUG_ON(PMD_ENTRY_SIZE != sizeof(pmd_t));
@@ -603,33 +598,6 @@ void __init mem_init(void)
603 } 598 }
604#endif 599#endif
605 600
606 codesize = (unsigned long)_etext - (unsigned long)_text;
607 datasize = (unsigned long)_edata - (unsigned long)_etext;
608 initsize = (unsigned long)__init_end - (unsigned long)__init_begin;
609
610 reservedpages = 0;
611{
612 unsigned long pfn;
613#ifdef CONFIG_DISCONTIGMEM
614 int i;
615
616 for (i = 0; i < npmem_ranges; i++) {
617 for (pfn = node_start_pfn(i); pfn < node_end_pfn(i); pfn++) {
618 if (PageReserved(pfn_to_page(pfn)))
619 reservedpages++;
620 }
621 }
622#else /* !CONFIG_DISCONTIGMEM */
623 for (pfn = 0; pfn < max_pfn; pfn++) {
624 /*
625 * Only count reserved RAM pages
626 */
627 if (PageReserved(pfn_to_page(pfn)))
628 reservedpages++;
629 }
630#endif
631}
632
633#ifdef CONFIG_PA11 601#ifdef CONFIG_PA11
634 if (hppa_dma_ops == &pcxl_dma_ops) { 602 if (hppa_dma_ops == &pcxl_dma_ops) {
635 pcxl_dma_start = (unsigned long)SET_MAP_OFFSET(MAP_START); 603 pcxl_dma_start = (unsigned long)SET_MAP_OFFSET(MAP_START);
@@ -643,15 +611,7 @@ void __init mem_init(void)
643 parisc_vmalloc_start = SET_MAP_OFFSET(MAP_START); 611 parisc_vmalloc_start = SET_MAP_OFFSET(MAP_START);
644#endif 612#endif
645 613
646 printk(KERN_INFO "Memory: %luk/%luk available (%dk kernel code, %dk reserved, %dk data, %dk init)\n", 614 mem_init_print_info(NULL);
647 nr_free_pages() << (PAGE_SHIFT-10),
648 num_physpages << (PAGE_SHIFT-10),
649 codesize >> 10,
650 reservedpages << (PAGE_SHIFT-10),
651 datasize >> 10,
652 initsize >> 10
653 );
654
655#ifdef CONFIG_DEBUG_KERNEL /* double-sanity-check paranoia */ 615#ifdef CONFIG_DEBUG_KERNEL /* double-sanity-check paranoia */
656 printk("virtual kernel memory layout:\n" 616 printk("virtual kernel memory layout:\n"
657 " vmalloc : 0x%p - 0x%p (%4ld MB)\n" 617 " vmalloc : 0x%p - 0x%p (%4ld MB)\n"
@@ -1101,7 +1061,6 @@ void flush_tlb_all(void)
1101#ifdef CONFIG_BLK_DEV_INITRD 1061#ifdef CONFIG_BLK_DEV_INITRD
1102void free_initrd_mem(unsigned long start, unsigned long end) 1062void free_initrd_mem(unsigned long start, unsigned long end)
1103{ 1063{
1104 num_physpages += free_reserved_area((void *)start, (void *)end, -1, 1064 free_reserved_area((void *)start, (void *)end, -1, "initrd");
1105 "initrd");
1106} 1065}
1107#endif 1066#endif