aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorYasunori Goto <y-goto@jp.fujitsu.com>2007-05-08 03:23:07 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-05-08 14:14:57 -0400
commita3142c8e1dd57ff48040bdb3478cff9312543dc3 (patch)
tree14beeb03421338b917a956e9269a2ce95e0f62cf /mm
parent0ceb331433e8aad9c5f441a965d7c681f8b9046f (diff)
Fix section mismatch of memory hotplug related code.
This is to fix many section mismatches of code related to memory hotplug. I checked compile with memory hotplug on/off on ia64 and x86-64 box. Signed-off-by: Yasunori Goto <y-goto@jp.fujitsu.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm')
-rw-r--r--mm/page_alloc.c26
-rw-r--r--mm/sparse.c10
2 files changed, 19 insertions, 17 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 59164313167..fd7745111e1 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -103,7 +103,7 @@ int min_free_kbytes = 1024;
103 103
104unsigned long __meminitdata nr_kernel_pages; 104unsigned long __meminitdata nr_kernel_pages;
105unsigned long __meminitdata nr_all_pages; 105unsigned long __meminitdata nr_all_pages;
106static unsigned long __initdata dma_reserve; 106static unsigned long __meminitdata dma_reserve;
107 107
108#ifdef CONFIG_ARCH_POPULATES_NODE_MAP 108#ifdef CONFIG_ARCH_POPULATES_NODE_MAP
109 /* 109 /*
@@ -126,10 +126,10 @@ static unsigned long __initdata dma_reserve;
126 #endif 126 #endif
127 #endif 127 #endif
128 128
129 struct node_active_region __initdata early_node_map[MAX_ACTIVE_REGIONS]; 129 struct node_active_region __meminitdata early_node_map[MAX_ACTIVE_REGIONS];
130 int __initdata nr_nodemap_entries; 130 int __meminitdata nr_nodemap_entries;
131 unsigned long __initdata arch_zone_lowest_possible_pfn[MAX_NR_ZONES]; 131 unsigned long __meminitdata arch_zone_lowest_possible_pfn[MAX_NR_ZONES];
132 unsigned long __initdata arch_zone_highest_possible_pfn[MAX_NR_ZONES]; 132 unsigned long __meminitdata arch_zone_highest_possible_pfn[MAX_NR_ZONES];
133#ifdef CONFIG_MEMORY_HOTPLUG_RESERVE 133#ifdef CONFIG_MEMORY_HOTPLUG_RESERVE
134 unsigned long __initdata node_boundary_start_pfn[MAX_NUMNODES]; 134 unsigned long __initdata node_boundary_start_pfn[MAX_NUMNODES];
135 unsigned long __initdata node_boundary_end_pfn[MAX_NUMNODES]; 135 unsigned long __initdata node_boundary_end_pfn[MAX_NUMNODES];
@@ -2267,7 +2267,7 @@ __meminit int init_currently_empty_zone(struct zone *zone,
2267 * Basic iterator support. Return the first range of PFNs for a node 2267 * Basic iterator support. Return the first range of PFNs for a node
2268 * Note: nid == MAX_NUMNODES returns first region regardless of node 2268 * Note: nid == MAX_NUMNODES returns first region regardless of node
2269 */ 2269 */
2270static int __init first_active_region_index_in_nid(int nid) 2270static int __meminit first_active_region_index_in_nid(int nid)
2271{ 2271{
2272 int i; 2272 int i;
2273 2273
@@ -2282,7 +2282,7 @@ static int __init first_active_region_index_in_nid(int nid)
2282 * Basic iterator support. Return the next active range of PFNs for a node 2282 * Basic iterator support. Return the next active range of PFNs for a node
2283 * Note: nid == MAX_NUMNODES returns next region regardles of node 2283 * Note: nid == MAX_NUMNODES returns next region regardles of node
2284 */ 2284 */
2285static int __init next_active_region_index_in_nid(int index, int nid) 2285static int __meminit next_active_region_index_in_nid(int index, int nid)
2286{ 2286{
2287 for (index = index + 1; index < nr_nodemap_entries; index++) 2287 for (index = index + 1; index < nr_nodemap_entries; index++)
2288 if (nid == MAX_NUMNODES || early_node_map[index].nid == nid) 2288 if (nid == MAX_NUMNODES || early_node_map[index].nid == nid)
@@ -2435,7 +2435,7 @@ static void __init account_node_boundary(unsigned int nid,
2435 * with no available memory, a warning is printed and the start and end 2435 * with no available memory, a warning is printed and the start and end
2436 * PFNs will be 0. 2436 * PFNs will be 0.
2437 */ 2437 */
2438void __init get_pfn_range_for_nid(unsigned int nid, 2438void __meminit get_pfn_range_for_nid(unsigned int nid,
2439 unsigned long *start_pfn, unsigned long *end_pfn) 2439 unsigned long *start_pfn, unsigned long *end_pfn)
2440{ 2440{
2441 int i; 2441 int i;
@@ -2460,7 +2460,7 @@ void __init get_pfn_range_for_nid(unsigned int nid,
2460 * Return the number of pages a zone spans in a node, including holes 2460 * Return the number of pages a zone spans in a node, including holes
2461 * present_pages = zone_spanned_pages_in_node() - zone_absent_pages_in_node() 2461 * present_pages = zone_spanned_pages_in_node() - zone_absent_pages_in_node()
2462 */ 2462 */
2463unsigned long __init zone_spanned_pages_in_node(int nid, 2463unsigned long __meminit zone_spanned_pages_in_node(int nid,
2464 unsigned long zone_type, 2464 unsigned long zone_type,
2465 unsigned long *ignored) 2465 unsigned long *ignored)
2466{ 2466{
@@ -2488,7 +2488,7 @@ unsigned long __init zone_spanned_pages_in_node(int nid,
2488 * Return the number of holes in a range on a node. If nid is MAX_NUMNODES, 2488 * Return the number of holes in a range on a node. If nid is MAX_NUMNODES,
2489 * then all holes in the requested range will be accounted for. 2489 * then all holes in the requested range will be accounted for.
2490 */ 2490 */
2491unsigned long __init __absent_pages_in_range(int nid, 2491unsigned long __meminit __absent_pages_in_range(int nid,
2492 unsigned long range_start_pfn, 2492 unsigned long range_start_pfn,
2493 unsigned long range_end_pfn) 2493 unsigned long range_end_pfn)
2494{ 2494{
@@ -2548,7 +2548,7 @@ unsigned long __init absent_pages_in_range(unsigned long start_pfn,
2548} 2548}
2549 2549
2550/* Return the number of page frames in holes in a zone on a node */ 2550/* Return the number of page frames in holes in a zone on a node */
2551unsigned long __init zone_absent_pages_in_node(int nid, 2551unsigned long __meminit zone_absent_pages_in_node(int nid,
2552 unsigned long zone_type, 2552 unsigned long zone_type,
2553 unsigned long *ignored) 2553 unsigned long *ignored)
2554{ 2554{
@@ -2584,7 +2584,7 @@ static inline unsigned long zone_absent_pages_in_node(int nid,
2584 2584
2585#endif 2585#endif
2586 2586
2587static void __init calculate_node_totalpages(struct pglist_data *pgdat, 2587static void __meminit calculate_node_totalpages(struct pglist_data *pgdat,
2588 unsigned long *zones_size, unsigned long *zholes_size) 2588 unsigned long *zones_size, unsigned long *zholes_size)
2589{ 2589{
2590 unsigned long realtotalpages, totalpages = 0; 2590 unsigned long realtotalpages, totalpages = 0;
@@ -2692,7 +2692,7 @@ static void __meminit free_area_init_core(struct pglist_data *pgdat,
2692 } 2692 }
2693} 2693}
2694 2694
2695static void __init alloc_node_mem_map(struct pglist_data *pgdat) 2695static void __meminit alloc_node_mem_map(struct pglist_data *pgdat)
2696{ 2696{
2697 /* Skip empty nodes */ 2697 /* Skip empty nodes */
2698 if (!pgdat->node_spanned_pages) 2698 if (!pgdat->node_spanned_pages)
diff --git a/mm/sparse.c b/mm/sparse.c
index 893e5621c24..9079afe8f45 100644
--- a/mm/sparse.c
+++ b/mm/sparse.c
@@ -61,7 +61,7 @@ static struct mem_section *sparse_index_alloc(int nid)
61 return section; 61 return section;
62} 62}
63 63
64static int sparse_index_init(unsigned long section_nr, int nid) 64static int __meminit sparse_index_init(unsigned long section_nr, int nid)
65{ 65{
66 static DEFINE_SPINLOCK(index_init_lock); 66 static DEFINE_SPINLOCK(index_init_lock);
67 unsigned long root = SECTION_NR_TO_ROOT(section_nr); 67 unsigned long root = SECTION_NR_TO_ROOT(section_nr);
@@ -138,7 +138,7 @@ static inline int sparse_early_nid(struct mem_section *section)
138} 138}
139 139
140/* Record a memory area against a node. */ 140/* Record a memory area against a node. */
141void memory_present(int nid, unsigned long start, unsigned long end) 141void __init memory_present(int nid, unsigned long start, unsigned long end)
142{ 142{
143 unsigned long pfn; 143 unsigned long pfn;
144 144
@@ -197,7 +197,7 @@ struct page *sparse_decode_mem_map(unsigned long coded_mem_map, unsigned long pn
197 return ((struct page *)coded_mem_map) + section_nr_to_pfn(pnum); 197 return ((struct page *)coded_mem_map) + section_nr_to_pfn(pnum);
198} 198}
199 199
200static int sparse_init_one_section(struct mem_section *ms, 200static int __meminit sparse_init_one_section(struct mem_section *ms,
201 unsigned long pnum, struct page *mem_map) 201 unsigned long pnum, struct page *mem_map)
202{ 202{
203 if (!valid_section(ms)) 203 if (!valid_section(ms))
@@ -209,7 +209,7 @@ static int sparse_init_one_section(struct mem_section *ms,
209 return 1; 209 return 1;
210} 210}
211 211
212static struct page *sparse_early_mem_map_alloc(unsigned long pnum) 212static struct page __init *sparse_early_mem_map_alloc(unsigned long pnum)
213{ 213{
214 struct page *map; 214 struct page *map;
215 struct mem_section *ms = __nr_to_section(pnum); 215 struct mem_section *ms = __nr_to_section(pnum);
@@ -288,6 +288,7 @@ void __init sparse_init(void)
288 } 288 }
289} 289}
290 290
291#ifdef CONFIG_MEMORY_HOTPLUG
291/* 292/*
292 * returns the number of sections whose mem_maps were properly 293 * returns the number of sections whose mem_maps were properly
293 * set. If this is <=0, then that means that the passed-in 294 * set. If this is <=0, then that means that the passed-in
@@ -327,3 +328,4 @@ out:
327 __kfree_section_memmap(memmap, nr_pages); 328 __kfree_section_memmap(memmap, nr_pages);
328 return ret; 329 return ret;
329} 330}
331#endif