diff options
author | Mel Gorman <mel@csn.ul.ie> | 2006-09-27 04:49:54 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-09-27 11:26:11 -0400 |
commit | 05e0caad3b7bd0d0fbeff980bca22f186241a501 (patch) | |
tree | d213789aca5bf91b74bbf5946d428590e3e368b1 /arch/ia64/mm/discontig.c | |
parent | 5cb248abf5ab65ab543b2d5fc16c738b28031fc0 (diff) |
[PATCH] Have ia64 use add_active_range() and free_area_init_nodes
Size zones and holes in an architecture independent manner for ia64.
[bob.picco@hp.com: fix ia64 FLATMEM+VIRTUAL_MEM_MAP]
Signed-off-by: Mel Gorman <mel@csn.ul.ie>
Signed-off-by: Bob Picco <bob.picco@hp.com>
Cc: Dave Hansen <haveblue@us.ibm.com>
Cc: Andy Whitcroft <apw@shadowen.org>
Cc: Andi Kleen <ak@muc.de>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: "Keith Mannthey" <kmannth@gmail.com>
Cc: "Luck, Tony" <tony.luck@intel.com>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Yasunori Goto <y-goto@jp.fujitsu.com>
Signed-off-by: Bob Picco <bob.picco@hp.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/ia64/mm/discontig.c')
-rw-r--r-- | arch/ia64/mm/discontig.c | 44 |
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 | |||
678 | void __init paging_init(void) | 679 | void __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 | ||