diff options
author | Jiang Liu <liuj97@gmail.com> | 2013-07-03 18:03:58 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-07-03 19:07:36 -0400 |
commit | de4bcddc13be31c669fc74cd2b400e1e7a1fdbcf (patch) | |
tree | 4459e1e94c03e4f2c7396ddb517eedf9d2def134 /arch/ia64 | |
parent | 5dc355c146689ac5a9d57dff349958585da21fe3 (diff) |
mm/IA64: 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: Tony Luck <tony.luck@intel.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: Zhang Yanfei <zhangyanfei@cn.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/ia64')
-rw-r--r-- | arch/ia64/mm/contig.c | 11 | ||||
-rw-r--r-- | arch/ia64/mm/discontig.c | 3 | ||||
-rw-r--r-- | arch/ia64/mm/init.c | 27 |
3 files changed, 1 insertions, 40 deletions
diff --git a/arch/ia64/mm/contig.c b/arch/ia64/mm/contig.c index 67c59ebec899..e4a6a5366dea 100644 --- a/arch/ia64/mm/contig.c +++ b/arch/ia64/mm/contig.c | |||
@@ -295,14 +295,6 @@ find_memory (void) | |||
295 | alloc_per_cpu_data(); | 295 | alloc_per_cpu_data(); |
296 | } | 296 | } |
297 | 297 | ||
298 | static int count_pages(u64 start, u64 end, void *arg) | ||
299 | { | ||
300 | unsigned long *count = arg; | ||
301 | |||
302 | *count += (end - start) >> PAGE_SHIFT; | ||
303 | return 0; | ||
304 | } | ||
305 | |||
306 | /* | 298 | /* |
307 | * Set up the page tables. | 299 | * Set up the page tables. |
308 | */ | 300 | */ |
@@ -313,9 +305,6 @@ paging_init (void) | |||
313 | unsigned long max_dma; | 305 | unsigned long max_dma; |
314 | unsigned long max_zone_pfns[MAX_NR_ZONES]; | 306 | unsigned long max_zone_pfns[MAX_NR_ZONES]; |
315 | 307 | ||
316 | num_physpages = 0; | ||
317 | efi_memmap_walk(count_pages, &num_physpages); | ||
318 | |||
319 | memset(max_zone_pfns, 0, sizeof(max_zone_pfns)); | 308 | memset(max_zone_pfns, 0, sizeof(max_zone_pfns)); |
320 | #ifdef CONFIG_ZONE_DMA | 309 | #ifdef CONFIG_ZONE_DMA |
321 | max_dma = virt_to_phys((void *) MAX_DMA_ADDRESS) >> PAGE_SHIFT; | 310 | max_dma = virt_to_phys((void *) MAX_DMA_ADDRESS) >> PAGE_SHIFT; |
diff --git a/arch/ia64/mm/discontig.c b/arch/ia64/mm/discontig.c index ae4db4bd6d97..58550b8f7d40 100644 --- a/arch/ia64/mm/discontig.c +++ b/arch/ia64/mm/discontig.c | |||
@@ -37,7 +37,6 @@ struct early_node_data { | |||
37 | struct ia64_node_data *node_data; | 37 | struct ia64_node_data *node_data; |
38 | unsigned long pernode_addr; | 38 | unsigned long pernode_addr; |
39 | unsigned long pernode_size; | 39 | unsigned long pernode_size; |
40 | unsigned long num_physpages; | ||
41 | #ifdef CONFIG_ZONE_DMA | 40 | #ifdef CONFIG_ZONE_DMA |
42 | unsigned long num_dma_physpages; | 41 | unsigned long num_dma_physpages; |
43 | #endif | 42 | #endif |
@@ -732,7 +731,6 @@ static __init int count_node_pages(unsigned long start, unsigned long len, int n | |||
732 | { | 731 | { |
733 | unsigned long end = start + len; | 732 | unsigned long end = start + len; |
734 | 733 | ||
735 | mem_data[node].num_physpages += len >> PAGE_SHIFT; | ||
736 | #ifdef CONFIG_ZONE_DMA | 734 | #ifdef CONFIG_ZONE_DMA |
737 | if (start <= __pa(MAX_DMA_ADDRESS)) | 735 | if (start <= __pa(MAX_DMA_ADDRESS)) |
738 | mem_data[node].num_dma_physpages += | 736 | mem_data[node].num_dma_physpages += |
@@ -778,7 +776,6 @@ void __init paging_init(void) | |||
778 | #endif | 776 | #endif |
779 | 777 | ||
780 | for_each_online_node(node) { | 778 | for_each_online_node(node) { |
781 | num_physpages += mem_data[node].num_physpages; | ||
782 | pfn_offset = mem_data[node].min_pfn; | 779 | pfn_offset = mem_data[node].min_pfn; |
783 | 780 | ||
784 | #ifdef CONFIG_VIRTUAL_MEM_MAP | 781 | #ifdef CONFIG_VIRTUAL_MEM_MAP |
diff --git a/arch/ia64/mm/init.c b/arch/ia64/mm/init.c index d141f7ea0be5..2d372b4c5f70 100644 --- a/arch/ia64/mm/init.c +++ b/arch/ia64/mm/init.c | |||
@@ -545,19 +545,6 @@ int __init register_active_ranges(u64 start, u64 len, int nid) | |||
545 | return 0; | 545 | return 0; |
546 | } | 546 | } |
547 | 547 | ||
548 | static int __init | ||
549 | count_reserved_pages(u64 start, u64 end, void *arg) | ||
550 | { | ||
551 | unsigned long num_reserved = 0; | ||
552 | unsigned long *count = arg; | ||
553 | |||
554 | for (; start < end; start += PAGE_SIZE) | ||
555 | if (PageReserved(virt_to_page(start))) | ||
556 | ++num_reserved; | ||
557 | *count += num_reserved; | ||
558 | return 0; | ||
559 | } | ||
560 | |||
561 | int | 548 | int |
562 | find_max_min_low_pfn (u64 start, u64 end, void *arg) | 549 | find_max_min_low_pfn (u64 start, u64 end, void *arg) |
563 | { | 550 | { |
@@ -596,7 +583,6 @@ __setup("nolwsys", nolwsys_setup); | |||
596 | void __init | 583 | void __init |
597 | mem_init (void) | 584 | mem_init (void) |
598 | { | 585 | { |
599 | long reserved_pages, codesize, datasize, initsize; | ||
600 | pg_data_t *pgdat; | 586 | pg_data_t *pgdat; |
601 | int i; | 587 | int i; |
602 | 588 | ||
@@ -624,18 +610,7 @@ mem_init (void) | |||
624 | if (pgdat->bdata->node_bootmem_map) | 610 | if (pgdat->bdata->node_bootmem_map) |
625 | free_all_bootmem_node(pgdat); | 611 | free_all_bootmem_node(pgdat); |
626 | 612 | ||
627 | reserved_pages = 0; | 613 | mem_init_print_info(NULL); |
628 | efi_memmap_walk(count_reserved_pages, &reserved_pages); | ||
629 | |||
630 | codesize = (unsigned long) _etext - (unsigned long) _stext; | ||
631 | datasize = (unsigned long) _edata - (unsigned long) _etext; | ||
632 | initsize = (unsigned long) __init_end - (unsigned long) __init_begin; | ||
633 | |||
634 | printk(KERN_INFO "Memory: %luk/%luk available (%luk code, %luk reserved, " | ||
635 | "%luk data, %luk init)\n", nr_free_pages() << (PAGE_SHIFT - 10), | ||
636 | num_physpages << (PAGE_SHIFT - 10), codesize >> 10, | ||
637 | reserved_pages << (PAGE_SHIFT - 10), datasize >> 10, initsize >> 10); | ||
638 | |||
639 | 614 | ||
640 | /* | 615 | /* |
641 | * For fsyscall entrpoints with no light-weight handler, use the ordinary | 616 | * For fsyscall entrpoints with no light-weight handler, use the ordinary |