X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=init%2Fmain.c;h=c691f5f7fc27b40ea6b2df39e2fef9ac52b4cd0a;hb=d31d29540915f21d3f2bcfdd6d135fde328038a0;hp=9def935ab13a27c829e28bb2830cdbe2c6fd900d;hpb=532df780a2012ad75b3f078647f229c4dabd99d1;p=linux-2.6 diff --git a/init/main.c b/init/main.c index 9def935ab1..c691f5f7fc 100644 --- a/init/main.c +++ b/init/main.c @@ -39,6 +39,7 @@ #include #include #include +#include #include #include #include @@ -55,6 +56,8 @@ #include #include #include +#include +#include #include #include @@ -69,15 +72,7 @@ /* * This is one of the first .c files built. Error out early if we have compiler * trouble. - * - * Versions of gcc older than that listed below may actually compile and link - * okay, but the end product can have subtle run time bugs. To avoid associated - * bogus bug reports, we flatly refuse to compile with a gcc that is known to be - * too old from the very beginning. */ -#if (__GNUC__ < 3) || (__GNUC__ == 3 && __GNUC_MINOR__ < 2) -#error Sorry, your GCC is too old. It builds incorrect kernels. -#endif #if __GNUC__ == 4 && __GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ == 0 #warning gcc-4.1.0 is known to miscompile the kernel. A different compiler version is recommended. @@ -89,7 +84,6 @@ extern void init_IRQ(void); extern void fork_init(unsigned long); extern void mca_init(void); extern void sbus_init(void); -extern void signals_init(void); extern void pidhash_init(void); extern void pidmap_init(void); extern void prio_tree_init(void); @@ -134,7 +128,7 @@ static char *ramdisk_execute_command; #ifdef CONFIG_SMP /* Setup configured maximum number of CPUs to activate */ -static unsigned int __initdata max_cpus = NR_CPUS; +unsigned int __initdata setup_max_cpus = NR_CPUS; /* * Setup routine for controlling SMP activation @@ -152,7 +146,7 @@ static inline void disable_ioapic_setup(void) {}; static int __init nosmp(char *str) { - max_cpus = 0; + setup_max_cpus = 0; disable_ioapic_setup(); return 0; } @@ -161,8 +155,8 @@ early_param("nosmp", nosmp); static int __init maxcpus(char *str) { - get_option(&str, &max_cpus); - if (max_cpus == 0) + get_option(&str, &setup_max_cpus); + if (setup_max_cpus == 0) disable_ioapic_setup(); return 0; @@ -170,7 +164,7 @@ static int __init maxcpus(char *str) early_param("maxcpus", maxcpus); #else -#define max_cpus NR_CPUS +#define setup_max_cpus NR_CPUS #endif /* @@ -287,7 +281,7 @@ static int __init unknown_bootoption(char *param, char *val) return 0; /* - * Preemptive maintenance for "why didn't my mispelled command + * Preemptive maintenance for "why didn't my misspelled command * line work?" */ if (strchr(param, '.') && (!val || strchr(param, '.') < val)) { @@ -324,6 +318,10 @@ static int __init unknown_bootoption(char *param, char *val) return 0; } +#ifdef CONFIG_DEBUG_PAGEALLOC +int __read_mostly debug_pagealloc_enabled = 0; +#endif + static int __init init_setup(char *str) { unsigned int i; @@ -369,7 +367,7 @@ static inline void smp_prepare_cpus(unsigned int maxcpus) { } #else -#ifdef __GENERIC_PER_CPU +#ifndef CONFIG_HAVE_SETUP_PER_CPU_AREA unsigned long __per_cpu_offset[NR_CPUS] __read_mostly; EXPORT_SYMBOL(__per_cpu_offset); @@ -390,7 +388,7 @@ static void __init setup_per_cpu_areas(void) ptr += size; } } -#endif /* !__GENERIC_PER_CPU */ +#endif /* CONFIG_HAVE_SETUP_PER_CPU_AREA */ /* Called by boot processor to activate the rest. */ static void __init smp_init(void) @@ -399,7 +397,7 @@ static void __init smp_init(void) /* FIXME: This should be done in userspace --RR */ for_each_present_cpu(cpu) { - if (num_online_cpus() >= max_cpus) + if (num_online_cpus() >= setup_max_cpus) break; if (!cpu_online(cpu)) cpu_up(cpu); @@ -407,7 +405,7 @@ static void __init smp_init(void) /* Any cleanup work */ printk(KERN_INFO "Brought up %ld CPUs\n", (long)num_online_cpus()); - smp_cpus_done(max_cpus); + smp_cpus_done(setup_max_cpus); } #endif @@ -523,6 +521,7 @@ asmlinkage void __init start_kernel(void) */ unwind_init(); lockdep_init(); + cgroup_init_early(); local_irq_disable(); early_boot_irqs_off(); @@ -557,6 +556,7 @@ asmlinkage void __init start_kernel(void) preempt_disable(); build_all_zonelists(); page_alloc_init(); + enable_debug_pagealloc(); printk(KERN_NOTICE "Kernel command line: %s\n", boot_command_line); parse_early_param(); parse_args("Booting kernel", static_command_line, __start___param, @@ -612,6 +612,7 @@ asmlinkage void __init start_kernel(void) vfs_caches_init_early(); cpuset_init_early(); mem_init(); + cpu_hotplug_init(); kmem_cache_init(); setup_per_cpu_pageset(); numa_policy_init(); @@ -640,6 +641,7 @@ asmlinkage void __init start_kernel(void) #ifdef CONFIG_PROC_FS proc_root_init(); #endif + cgroup_init(); cpuset_init(); taskstats_init_early(); delayacct_init(); @@ -752,11 +754,8 @@ __setup("nosoftlockup", nosoftlockup_setup); static void __init do_pre_smp_initcalls(void) { extern int spawn_ksoftirqd(void); -#ifdef CONFIG_SMP - extern int migration_init(void); migration_init(); -#endif spawn_ksoftirqd(); if (!nosoftlockup) spawn_softlockup_task(); @@ -830,7 +829,7 @@ static int __init kernel_init(void * unused) __set_special_pids(1, 1); cad_pid = task_pid(current); - smp_prepare_cpus(max_cpus); + smp_prepare_cpus(setup_max_cpus); do_pre_smp_initcalls();