]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
Full conversion to early_initcall() interface, remove old interface
authorEduard - Gabriel Munteanu <eduard.munteanu@linux360.ro>
Sat, 26 Jul 2008 02:45:11 +0000 (19:45 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 26 Jul 2008 19:00:04 +0000 (12:00 -0700)
A previous patch added the early_initcall(), to allow a cleaner hooking of
pre-SMP initcalls.  Now we remove the older interface, converting all
existing users to the new one.

[akpm@linux-foundation.org: cleanups]
[akpm@linux-foundation.org: build fix]
[kosaki.motohiro@jp.fujitsu.com: warning fix]
[kosaki.motohiro@jp.fujitsu.com: warning fix]
Signed-off-by: Eduard - Gabriel Munteanu <eduard.munteanu@linux360.ro>
Cc: Tom Zanussi <tzanussi@gmail.com>
Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
include/linux/sched.h
include/linux/smp.h
init/main.c
kernel/sched.c
kernel/smp.c
kernel/softirq.c
kernel/softlockup.c

index 3260a5c42b9109f4bfb58bae3ea453150cf08cef..adb8077dc463dc9c3f1686dbe0a63352f9bf873d 100644 (file)
@@ -292,7 +292,6 @@ extern void sched_show_task(struct task_struct *p);
 
 #ifdef CONFIG_DETECT_SOFTLOCKUP
 extern void softlockup_tick(void);
-extern void spawn_softlockup_task(void);
 extern void touch_softlockup_watchdog(void);
 extern void touch_all_softlockup_watchdogs(void);
 extern unsigned int  softlockup_panic;
@@ -2222,14 +2221,6 @@ static inline void inc_syscw(struct task_struct *tsk)
 }
 #endif
 
-#ifdef CONFIG_SMP
-void migration_init(void);
-#else
-static inline void migration_init(void)
-{
-}
-#endif
-
 #ifndef TASK_SIZE_OF
 #define TASK_SIZE_OF(tsk)      TASK_SIZE
 #endif
index 48262f86c969dccd11486ef772907845d6cb45cb..66484d4a845944d8e7250f0cd6932febe2c8933b 100644 (file)
@@ -74,15 +74,10 @@ void __smp_call_function_single(int cpuid, struct call_single_data *data);
 #ifdef CONFIG_USE_GENERIC_SMP_HELPERS
 void generic_smp_call_function_single_interrupt(void);
 void generic_smp_call_function_interrupt(void);
-void init_call_single_data(void);
 void ipi_call_lock(void);
 void ipi_call_unlock(void);
 void ipi_call_lock_irq(void);
 void ipi_call_unlock_irq(void);
-#else
-static inline void init_call_single_data(void)
-{
-}
 #endif
 
 /*
index b6fec08dbbef65236edd042b7834be771de6faf0..20fdc9884b77184f1b77d5ca857305c8a0d8dd21 100644 (file)
@@ -774,16 +774,7 @@ static void __init do_basic_setup(void)
        do_initcalls();
 }
 
-static int __initdata nosoftlockup;
-
-static int __init nosoftlockup_setup(char *str)
-{
-       nosoftlockup = 1;
-       return 1;
-}
-__setup("nosoftlockup", nosoftlockup_setup);
-
-static void __init __do_pre_smp_initcalls(void)
+static void __init do_pre_smp_initcalls(void)
 {
        initcall_t *call;
 
@@ -791,17 +782,6 @@ static void __init __do_pre_smp_initcalls(void)
                do_one_initcall(*call);
 }
 
-static void __init do_pre_smp_initcalls(void)
-{
-       extern int spawn_ksoftirqd(void);
-
-       init_call_single_data();
-       migration_init();
-       spawn_ksoftirqd();
-       if (!nosoftlockup)
-               spawn_softlockup_task();
-}
-
 static void run_init_process(char *init_filename)
 {
        argv_init[0] = init_filename;
@@ -873,7 +853,6 @@ static int __init kernel_init(void * unused)
 
        smp_prepare_cpus(setup_max_cpus);
 
-       __do_pre_smp_initcalls();
        do_pre_smp_initcalls();
 
        smp_init();
index 0047bd9b96aae2d0d86b0e1f528a29e6f2197b08..fde1a10263597e4f73792b97b4fe0edaa6880f6d 100644 (file)
@@ -6389,7 +6389,7 @@ static struct notifier_block __cpuinitdata migration_notifier = {
        .priority = 10
 };
 
-void __init migration_init(void)
+static int __init migration_init(void)
 {
        void *cpu = (void *)(long)smp_processor_id();
        int err;
@@ -6399,7 +6399,10 @@ void __init migration_init(void)
        BUG_ON(err == NOTIFY_BAD);
        migration_call(&migration_notifier, CPU_ONLINE, cpu);
        register_cpu_notifier(&migration_notifier);
+
+       return err;
 }
+early_initcall(migration_init);
 #endif
 
 #ifdef CONFIG_SMP
index 462c785ca1eee80dea958541edf19786259c88e6..96fc7c0edc59d1f09ca56a500d90b0a8a212c7d7 100644 (file)
@@ -33,7 +33,7 @@ struct call_single_queue {
        spinlock_t lock;
 };
 
-void __cpuinit init_call_single_data(void)
+static int __cpuinit init_call_single_data(void)
 {
        int i;
 
@@ -43,7 +43,9 @@ void __cpuinit init_call_single_data(void)
                spin_lock_init(&q->lock);
                INIT_LIST_HEAD(&q->list);
        }
+       return 0;
 }
+early_initcall(init_call_single_data);
 
 static void csd_flag_wait(struct call_single_data *data)
 {
index f6b03d56c2bf130d81a4cda68b193267ef6b7466..c506f266a6b90ee9d887b9eeecdd45061e74ef1f 100644 (file)
@@ -630,7 +630,7 @@ static struct notifier_block __cpuinitdata cpu_nfb = {
        .notifier_call = cpu_callback
 };
 
-__init int spawn_ksoftirqd(void)
+static __init int spawn_ksoftirqd(void)
 {
        void *cpu = (void *)(long)smp_processor_id();
        int err = cpu_callback(&cpu_nfb, CPU_UP_PREPARE, cpu);
@@ -640,6 +640,7 @@ __init int spawn_ksoftirqd(void)
        register_cpu_notifier(&cpu_nfb);
        return 0;
 }
+early_initcall(spawn_ksoftirqd);
 
 #ifdef CONFIG_SMP
 /*
index 7bd8d1aadd5d3693bd881791e1130b1f603f5bce..b75b492fbfcff63770bc099df2a7769fc1e26f09 100644 (file)
@@ -338,14 +338,33 @@ static struct notifier_block __cpuinitdata cpu_nfb = {
        .notifier_call = cpu_callback
 };
 
-__init void spawn_softlockup_task(void)
+static int __initdata nosoftlockup;
+
+static int __init nosoftlockup_setup(char *str)
+{
+       nosoftlockup = 1;
+       return 1;
+}
+__setup("nosoftlockup", nosoftlockup_setup);
+
+static int __init spawn_softlockup_task(void)
 {
        void *cpu = (void *)(long)smp_processor_id();
-       int err = cpu_callback(&cpu_nfb, CPU_UP_PREPARE, cpu);
+       int err;
 
-       BUG_ON(err == NOTIFY_BAD);
+       if (nosoftlockup)
+               return 0;
+
+       err = cpu_callback(&cpu_nfb, CPU_UP_PREPARE, cpu);
+       if (err == NOTIFY_BAD) {
+               BUG();
+               return 1;
+       }
        cpu_callback(&cpu_nfb, CPU_ONLINE, cpu);
        register_cpu_notifier(&cpu_nfb);
 
        atomic_notifier_chain_register(&panic_notifier_list, &panic_block);
+
+       return 0;
 }
+early_initcall(spawn_softlockup_task);