public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [patch 1/2] workqueue: mark init_workqueues() as early_initcall()
@ 2010-07-30 21:57 Suresh Siddha
  2010-07-30 21:57 ` [patch 2/2] x86, smp: use workqueues unconditionally during do_boot_cpu() Suresh Siddha
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Suresh Siddha @ 2010-07-30 21:57 UTC (permalink / raw)
  To: H. Peter Anvin, Ingo Molnar, Thomas Gleixner
  Cc: LKML, Suresh Siddha, Tejun Heo, Oleg Nesterov, Andrew Morton

[-- Attachment #1: init_workqueues_before_smp_init.patch --]
[-- Type: text/plain, Size: 2471 bytes --]

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>
Cc: Tejun Heo <tj@kernel.org>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
---
 include/linux/workqueue.h |    1 -
 init/main.c               |    2 --
 kernel/workqueue.c        |    4 +++-
 3 files changed, 3 insertions(+), 4 deletions(-)

Index: tip/init/main.c
===================================================================
--- tip.orig/init/main.c
+++ tip/init/main.c
@@ -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>
@@ -788,7 +787,6 @@ static void __init do_initcalls(void)
  */
 static void __init do_basic_setup(void)
 {
-	init_workqueues();
 	cpuset_init_smp();
 	usermodehelper_init();
 	init_tmpfs();
Index: tip/include/linux/workqueue.h
===================================================================
--- tip.orig/include/linux/workqueue.h
+++ tip/include/linux/workqueue.h
@@ -234,7 +234,6 @@ extern int schedule_on_each_cpu(work_fun
 extern int current_is_keventd(void);
 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: tip/kernel/workqueue.c
===================================================================
--- tip.orig/kernel/workqueue.c
+++ tip/kernel/workqueue.c
@@ -1216,7 +1216,7 @@ long work_on_cpu(unsigned int cpu, long 
 EXPORT_SYMBOL_GPL(work_on_cpu);
 #endif /* CONFIG_SMP */
 
-void __init init_workqueues(void)
+static int __init init_workqueues(void)
 {
 	alloc_cpumask_var(&cpu_populated_map, GFP_KERNEL);
 
@@ -1226,4 +1226,6 @@ void __init init_workqueues(void)
 	hotcpu_notifier(workqueue_cpu_callback, 0);
 	keventd_wq = create_workqueue("events");
 	BUG_ON(!keventd_wq);
+	return 0;
 }
+early_initcall(init_workqueues);



^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2010-08-04 13:43 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-30 21:57 [patch 1/2] workqueue: mark init_workqueues() as early_initcall() Suresh Siddha
2010-07-30 21:57 ` [patch 2/2] x86, smp: use workqueues unconditionally during do_boot_cpu() Suresh Siddha
2010-07-30 23:55 ` [patch 1/2] workqueue: mark init_workqueues() as early_initcall() Andrew Morton
2010-07-31  0:48   ` Suresh Siddha
2010-07-31 10:29     ` Tejun Heo
2010-07-31 10:27   ` Tejun Heo
2010-08-01  9:54   ` [PATCH wq#for-next] workqueue: explain for_each_*cwq_cpu() iterators Tejun Heo
2010-08-01 11:07 ` [PATCH] workqueue: mark init_workqueues() as early_initcall() Tejun Heo
2010-08-02 18:41   ` Suresh Siddha
2010-08-04 13:43     ` Tejun Heo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox