aboutsummaryrefslogtreecommitdiffstats
path: root/init/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'init/main.c')
-rw-r--r--init/main.c25
1 files changed, 15 insertions, 10 deletions
diff --git a/init/main.c b/init/main.c
index f287ca5862b9..cb81ed116f62 100644
--- a/init/main.c
+++ b/init/main.c
@@ -128,7 +128,7 @@ static char *ramdisk_execute_command;
128 128
129#ifdef CONFIG_SMP 129#ifdef CONFIG_SMP
130/* Setup configured maximum number of CPUs to activate */ 130/* Setup configured maximum number of CPUs to activate */
131static unsigned int __initdata max_cpus = NR_CPUS; 131unsigned int __initdata setup_max_cpus = NR_CPUS;
132 132
133/* 133/*
134 * Setup routine for controlling SMP activation 134 * Setup routine for controlling SMP activation
@@ -146,7 +146,7 @@ static inline void disable_ioapic_setup(void) {};
146 146
147static int __init nosmp(char *str) 147static int __init nosmp(char *str)
148{ 148{
149 max_cpus = 0; 149 setup_max_cpus = 0;
150 disable_ioapic_setup(); 150 disable_ioapic_setup();
151 return 0; 151 return 0;
152} 152}
@@ -155,8 +155,8 @@ early_param("nosmp", nosmp);
155 155
156static int __init maxcpus(char *str) 156static int __init maxcpus(char *str)
157{ 157{
158 get_option(&str, &max_cpus); 158 get_option(&str, &setup_max_cpus);
159 if (max_cpus == 0) 159 if (setup_max_cpus == 0)
160 disable_ioapic_setup(); 160 disable_ioapic_setup();
161 161
162 return 0; 162 return 0;
@@ -164,7 +164,7 @@ static int __init maxcpus(char *str)
164 164
165early_param("maxcpus", maxcpus); 165early_param("maxcpus", maxcpus);
166#else 166#else
167#define max_cpus NR_CPUS 167#define setup_max_cpus NR_CPUS
168#endif 168#endif
169 169
170/* 170/*
@@ -318,6 +318,10 @@ static int __init unknown_bootoption(char *param, char *val)
318 return 0; 318 return 0;
319} 319}
320 320
321#ifdef CONFIG_DEBUG_PAGEALLOC
322int __read_mostly debug_pagealloc_enabled = 0;
323#endif
324
321static int __init init_setup(char *str) 325static int __init init_setup(char *str)
322{ 326{
323 unsigned int i; 327 unsigned int i;
@@ -363,7 +367,7 @@ static inline void smp_prepare_cpus(unsigned int maxcpus) { }
363 367
364#else 368#else
365 369
366#ifdef __GENERIC_PER_CPU 370#ifndef CONFIG_HAVE_SETUP_PER_CPU_AREA
367unsigned long __per_cpu_offset[NR_CPUS] __read_mostly; 371unsigned long __per_cpu_offset[NR_CPUS] __read_mostly;
368 372
369EXPORT_SYMBOL(__per_cpu_offset); 373EXPORT_SYMBOL(__per_cpu_offset);
@@ -384,7 +388,7 @@ static void __init setup_per_cpu_areas(void)
384 ptr += size; 388 ptr += size;
385 } 389 }
386} 390}
387#endif /* !__GENERIC_PER_CPU */ 391#endif /* CONFIG_HAVE_SETUP_PER_CPU_AREA */
388 392
389/* Called by boot processor to activate the rest. */ 393/* Called by boot processor to activate the rest. */
390static void __init smp_init(void) 394static void __init smp_init(void)
@@ -393,7 +397,7 @@ static void __init smp_init(void)
393 397
394 /* FIXME: This should be done in userspace --RR */ 398 /* FIXME: This should be done in userspace --RR */
395 for_each_present_cpu(cpu) { 399 for_each_present_cpu(cpu) {
396 if (num_online_cpus() >= max_cpus) 400 if (num_online_cpus() >= setup_max_cpus)
397 break; 401 break;
398 if (!cpu_online(cpu)) 402 if (!cpu_online(cpu))
399 cpu_up(cpu); 403 cpu_up(cpu);
@@ -401,7 +405,7 @@ static void __init smp_init(void)
401 405
402 /* Any cleanup work */ 406 /* Any cleanup work */
403 printk(KERN_INFO "Brought up %ld CPUs\n", (long)num_online_cpus()); 407 printk(KERN_INFO "Brought up %ld CPUs\n", (long)num_online_cpus());
404 smp_cpus_done(max_cpus); 408 smp_cpus_done(setup_max_cpus);
405} 409}
406 410
407#endif 411#endif
@@ -552,6 +556,7 @@ asmlinkage void __init start_kernel(void)
552 preempt_disable(); 556 preempt_disable();
553 build_all_zonelists(); 557 build_all_zonelists();
554 page_alloc_init(); 558 page_alloc_init();
559 enable_debug_pagealloc();
555 printk(KERN_NOTICE "Kernel command line: %s\n", boot_command_line); 560 printk(KERN_NOTICE "Kernel command line: %s\n", boot_command_line);
556 parse_early_param(); 561 parse_early_param();
557 parse_args("Booting kernel", static_command_line, __start___param, 562 parse_args("Booting kernel", static_command_line, __start___param,
@@ -824,7 +829,7 @@ static int __init kernel_init(void * unused)
824 __set_special_pids(1, 1); 829 __set_special_pids(1, 1);
825 cad_pid = task_pid(current); 830 cad_pid = task_pid(current);
826 831
827 smp_prepare_cpus(max_cpus); 832 smp_prepare_cpus(setup_max_cpus);
828 833
829 do_pre_smp_initcalls(); 834 do_pre_smp_initcalls();
830 835