aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ia64/mm/discontig.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/ia64/mm/discontig.c')
-rw-r--r--arch/ia64/mm/discontig.c44
1 files changed, 9 insertions, 35 deletions
diff --git a/arch/ia64/mm/discontig.c b/arch/ia64/mm/discontig.c
index d260bffa01ab..7bd28079dcc4 100644
--- a/arch/ia64/mm/discontig.c
+++ b/arch/ia64/mm/discontig.c
@@ -654,6 +654,7 @@ static __init int count_node_pages(unsigned long start, unsigned long len, int n
654{ 654{
655 unsigned long end = start + len; 655 unsigned long end = start + len;
656 656
657 add_active_range(node, start >> PAGE_SHIFT, end >> PAGE_SHIFT);
657 mem_data[node].num_physpages += len >> PAGE_SHIFT; 658 mem_data[node].num_physpages += len >> PAGE_SHIFT;
658 if (start <= __pa(MAX_DMA_ADDRESS)) 659 if (start <= __pa(MAX_DMA_ADDRESS))
659 mem_data[node].num_dma_physpages += 660 mem_data[node].num_dma_physpages +=
@@ -678,10 +679,10 @@ static __init int count_node_pages(unsigned long start, unsigned long len, int n
678void __init paging_init(void) 679void __init paging_init(void)
679{ 680{
680 unsigned long max_dma; 681 unsigned long max_dma;
681 unsigned long zones_size[MAX_NR_ZONES];
682 unsigned long zholes_size[MAX_NR_ZONES];
683 unsigned long pfn_offset = 0; 682 unsigned long pfn_offset = 0;
683 unsigned long max_pfn = 0;
684 int node; 684 int node;
685 unsigned long max_zone_pfns[MAX_NR_ZONES];
685 686
686 max_dma = virt_to_phys((void *) MAX_DMA_ADDRESS) >> PAGE_SHIFT; 687 max_dma = virt_to_phys((void *) MAX_DMA_ADDRESS) >> PAGE_SHIFT;
687 688
@@ -698,47 +699,20 @@ void __init paging_init(void)
698#endif 699#endif
699 700
700 for_each_online_node(node) { 701 for_each_online_node(node) {
701 memset(zones_size, 0, sizeof(zones_size));
702 memset(zholes_size, 0, sizeof(zholes_size));
703
704 num_physpages += mem_data[node].num_physpages; 702 num_physpages += mem_data[node].num_physpages;
705
706 if (mem_data[node].min_pfn >= max_dma) {
707 /* All of this node's memory is above ZONE_DMA */
708 zones_size[ZONE_NORMAL] = mem_data[node].max_pfn -
709 mem_data[node].min_pfn;
710 zholes_size[ZONE_NORMAL] = mem_data[node].max_pfn -
711 mem_data[node].min_pfn -
712 mem_data[node].num_physpages;
713 } else if (mem_data[node].max_pfn < max_dma) {
714 /* All of this node's memory is in ZONE_DMA */
715 zones_size[ZONE_DMA] = mem_data[node].max_pfn -
716 mem_data[node].min_pfn;
717 zholes_size[ZONE_DMA] = mem_data[node].max_pfn -
718 mem_data[node].min_pfn -
719 mem_data[node].num_dma_physpages;
720 } else {
721 /* This node has memory in both zones */
722 zones_size[ZONE_DMA] = max_dma -
723 mem_data[node].min_pfn;
724 zholes_size[ZONE_DMA] = zones_size[ZONE_DMA] -
725 mem_data[node].num_dma_physpages;
726 zones_size[ZONE_NORMAL] = mem_data[node].max_pfn -
727 max_dma;
728 zholes_size[ZONE_NORMAL] = zones_size[ZONE_NORMAL] -
729 (mem_data[node].num_physpages -
730 mem_data[node].num_dma_physpages);
731 }
732
733 pfn_offset = mem_data[node].min_pfn; 703 pfn_offset = mem_data[node].min_pfn;
734 704
735#ifdef CONFIG_VIRTUAL_MEM_MAP 705#ifdef CONFIG_VIRTUAL_MEM_MAP
736 NODE_DATA(node)->node_mem_map = vmem_map + pfn_offset; 706 NODE_DATA(node)->node_mem_map = vmem_map + pfn_offset;
737#endif 707#endif
738 free_area_init_node(node, NODE_DATA(node), zones_size, 708 if (mem_data[node].max_pfn > max_pfn)
739 pfn_offset, zholes_size); 709 max_pfn = mem_data[node].max_pfn;
740 } 710 }
741 711
712 max_zone_pfns[ZONE_DMA] = max_dma;
713 max_zone_pfns[ZONE_NORMAL] = max_pfn;
714 free_area_init_nodes(max_zone_pfns);
715
742 zero_page_memmap_ptr = virt_to_page(ia64_imva(empty_zero_page)); 716 zero_page_memmap_ptr = virt_to_page(ia64_imva(empty_zero_page));
743} 717}
744 718