]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
workqueue: mark init_workqueues() as early_initcall()
authorSuresh Siddha <suresh.b.siddha@intel.com>
Fri, 30 Jul 2010 21:57:37 +0000 (14:57 -0700)
committerTejun Heo <tj@kernel.org>
Sun, 1 Aug 2010 11:05:29 +0000 (13:05 +0200)
Mark init_workqueues() as early_initcall() and thus it will be initialized
before smp bringup. init_workqueues() registers for the hotcpu notifier
and thus it should cope with the processors that are brought online after
the workqueues are initialized.

x86 smp bringup code uses workqueues and uses a workaround for the
cold boot process (as the workqueues are initialized post smp_init()).
Marking init_workqueues() as early_initcall() will pave the way for
cleaning up this code.

Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
include/linux/workqueue.h
init/main.c
kernel/workqueue.c

index 5f76001c4e6d54ac5afc92492a5e5995705f6635..51dc9a727e5e254875b07886f47987f2feaa0db4 100644 (file)
@@ -327,7 +327,6 @@ extern int schedule_delayed_work_on(int cpu, struct delayed_work *work,
 extern int schedule_on_each_cpu(work_func_t func);
 extern int keventd_up(void);
 
-extern void init_workqueues(void);
 int execute_in_process_context(work_func_t fn, struct execute_work *);
 
 extern int flush_work(struct work_struct *work);
index 3bdb152f412f32b8edeeb1036a24f934988b5be2..5f2ec2cdd90087807086b5e82cc62e190ff462bb 100644 (file)
@@ -32,7 +32,6 @@
 #include <linux/start_kernel.h>
 #include <linux/security.h>
 #include <linux/smp.h>
-#include <linux/workqueue.h>
 #include <linux/profile.h>
 #include <linux/rcupdate.h>
 #include <linux/moduleparam.h>
@@ -786,7 +785,6 @@ static void __init do_initcalls(void)
  */
 static void __init do_basic_setup(void)
 {
-       init_workqueues();
        cpuset_init_smp();
        usermodehelper_init();
        init_tmpfs();
index 1105c474073ae02b79e634c5e3fc52b83130d1ee..e2eb351d915253c37c2b22345f7fe90eba1e754f 100644 (file)
@@ -3507,7 +3507,7 @@ out_unlock:
 }
 #endif /* CONFIG_FREEZER */
 
-void __init init_workqueues(void)
+static int __init init_workqueues(void)
 {
        unsigned int cpu;
        int i;
@@ -3559,4 +3559,6 @@ void __init init_workqueues(void)
        system_unbound_wq = alloc_workqueue("events_unbound", WQ_UNBOUND,
                                            WQ_UNBOUND_MAX_ACTIVE);
        BUG_ON(!system_wq || !system_long_wq || !system_nrt_wq);
+       return 0;
 }
+early_initcall(init_workqueues);