From: Tejun Heo <tj@kernel.org>
To: Suresh Siddha <suresh.b.siddha@intel.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>, Ingo Molnar <mingo@elte.hu>,
Thomas Gleixner <tglx@linutronix.de>,
LKML <linux-kernel@vger.kernel.org>,
Oleg Nesterov <oleg@redhat.com>,
Andrew Morton <akpm@linux-foundation.org>
Subject: [PATCH] workqueue: mark init_workqueues() as early_initcall()
Date: Sun, 01 Aug 2010 13:07:24 +0200 [thread overview]
Message-ID: <4C55556C.6050206@kernel.org> (raw)
In-Reply-To: <20100730215751.690706748@sbsiddha-MOBL3.sc.intel.com>
>From 6ee0578b4daaea01c96b172c6aacca43fd9807a6 Mon Sep 17 00:00:00 2001
From: Suresh Siddha <suresh.b.siddha@intel.com>
Date: Fri, 30 Jul 2010 14:57:37 -0700
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>
---
Audited and tested. It should be fine. Patch applied and pushed out
to linux-next. How shall we route the second patch?
Thanks.
include/linux/workqueue.h | 1 -
init/main.c | 2 --
kernel/workqueue.c | 4 +++-
3 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h
index 5f76001..51dc9a7 100644
--- a/include/linux/workqueue.h
+++ b/include/linux/workqueue.h
@@ -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);
diff --git a/init/main.c b/init/main.c
index 3bdb152..5f2ec2c 100644
--- a/init/main.c
+++ b/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>
@@ -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();
diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index 1105c47..e2eb351 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -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);
--
1.7.1
next prev parent reply other threads:[~2010-08-01 11:07 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
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 ` Tejun Heo [this message]
2010-08-02 18:41 ` [PATCH] workqueue: mark init_workqueues() as early_initcall() Suresh Siddha
2010-08-04 13:43 ` Tejun Heo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4C55556C.6050206@kernel.org \
--to=tj@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=oleg@redhat.com \
--cc=suresh.b.siddha@intel.com \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox