aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorYinghai Lu <Yinghai.Lu@Sun.COM>2008-01-30 07:33:09 -0500
committerIngo Molnar <mingo@elte.hu>2008-01-30 07:33:09 -0500
commita261670aed2b5b77a20ce9b15fed57abeb126c0e (patch)
treeb0ad46aff4a4bfd2cc47193dc0b36074440976a1 /arch
parent94878efdd0815fe3a4159007b1454b25c7696d53 (diff)
x86: cleanup setup_node_zones called by paging_init()
setup_node_zones() calcuates some variables but only use them when FLAT_NODE_MEM_MAP is set so change the MACRO postion to avoid calculating. also change it to static, and rename it to flat_setup_node_zones(). Signed-off-by: Yinghai Lu <yinghai.lu@sun.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/mm/numa_64.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/arch/x86/mm/numa_64.c b/arch/x86/mm/numa_64.c
index 848231481619..551e3590e5c5 100644
--- a/arch/x86/mm/numa_64.c
+++ b/arch/x86/mm/numa_64.c
@@ -233,8 +233,9 @@ void __init setup_node_bootmem(int nodeid, unsigned long start,
233 node_set_online(nodeid); 233 node_set_online(nodeid);
234} 234}
235 235
236#ifdef CONFIG_FLAT_NODE_MEM_MAP
236/* Initialize final allocator for a zone */ 237/* Initialize final allocator for a zone */
237void __init setup_node_zones(int nodeid) 238static void __init flat_setup_node_zones(int nodeid)
238{ 239{
239 unsigned long start_pfn, end_pfn, memmapsize, limit; 240 unsigned long start_pfn, end_pfn, memmapsize, limit;
240 241
@@ -250,14 +251,16 @@ void __init setup_node_zones(int nodeid)
250 */ 251 */
251 memmapsize = sizeof(struct page) * (end_pfn-start_pfn); 252 memmapsize = sizeof(struct page) * (end_pfn-start_pfn);
252 limit = end_pfn << PAGE_SHIFT; 253 limit = end_pfn << PAGE_SHIFT;
253#ifdef CONFIG_FLAT_NODE_MEM_MAP 254
254 NODE_DATA(nodeid)->node_mem_map = 255 NODE_DATA(nodeid)->node_mem_map =
255 __alloc_bootmem_core(NODE_DATA(nodeid)->bdata, 256 __alloc_bootmem_core(NODE_DATA(nodeid)->bdata,
256 memmapsize, SMP_CACHE_BYTES, 257 memmapsize, SMP_CACHE_BYTES,
257 round_down(limit - memmapsize, PAGE_SIZE), 258 round_down(limit - memmapsize, PAGE_SIZE),
258 limit); 259 limit);
259#endif
260} 260}
261#else
262#define flat_setup_node_zones(i) do {} while (0)
263#endif
261 264
262/* 265/*
263 * There are unfortunately some poorly designed mainboards around that 266 * There are unfortunately some poorly designed mainboards around that
@@ -581,7 +584,7 @@ void __init paging_init(void)
581 sparse_init(); 584 sparse_init();
582 585
583 for_each_online_node(i) 586 for_each_online_node(i)
584 setup_node_zones(i); 587 flat_setup_node_zones(i);
585 588
586 free_area_init_nodes(max_zone_pfns); 589 free_area_init_nodes(max_zone_pfns);
587} 590}