From: Tejun Heo <tj@kernel.org>
To: linux-kernel@vger.kernel.org, akpm@linux-foundation.org
Cc: Tejun Heo <tj@kernel.org>
Subject: [PATCH 1/6] init: don't call flush_scheduled_work() from do_initcalls()
Date: Sun, 12 Dec 2010 17:48:14 +0100 [thread overview]
Message-ID: <1292172499-21633-2-git-send-email-tj@kernel.org> (raw)
In-Reply-To: <1292172499-21633-1-git-send-email-tj@kernel.org>
The call to flush_scheduled_work() in do_initcalls() is there to make
sure all works queued to system_wq by initcalls finish before the init
sections are dropped.
However, the call doesn't make much sense at this point - there
already are multiple different workqueues and different subsystems are
free to create and use their own. Ordering requirements are and
should be expressed explicitly.
Drop the call to prepare for the deprecation and removal of
flush_scheduled_work().
Andrew suggested adding sanity check where the workqueue code checks
whether any pending or running work has the work function in the init
text section. However, checking this for running works requires the
worker to keep track of the current function being executed, and
checking only the pending works will miss most cases. As a violation
will almost always be caught by the usual page fault mechanism, I
don't think it would be worthwhile to make the workqueue code track
extra state just for this.
Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
---
This is part of a series to remove flush_scheduled_work() usage to
prepare for deprecation of flush_scheduled_work(). Patches in this
series are self contained and mostly straight-forward.
Please feel free to take it into the appropriate tree, or just ack it.
In the latter case, I'll merge the patch through the workqueue tree
during the next merge window.
Thank you.
init/main.c | 3 ---
1 files changed, 0 insertions(+), 3 deletions(-)
diff --git a/init/main.c b/init/main.c
index 8646401..5421e8f 100644
--- a/init/main.c
+++ b/init/main.c
@@ -775,9 +775,6 @@ static void __init do_initcalls(void)
for (fn = __early_initcall_end; fn < __initcall_end; fn++)
do_one_initcall(*fn);
-
- /* Make sure there is no pending stuff from the initcall sequence */
- flush_scheduled_work();
}
/*
--
1.7.1
next prev parent reply other threads:[~2010-12-12 16:48 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-12 16:48 [PATCHSET] workqueue: another assorted flush_scheduled_work() removals Tejun Heo
2010-12-12 16:48 ` Tejun Heo [this message]
2010-12-12 16:48 ` [PATCH 2/6] ioc4: use static work_struct for ioc4_load_modules() Tejun Heo
2010-12-12 16:48 ` [PATCH 3/6] media/video: explicitly flush request_module work Tejun Heo
2010-12-12 16:48 ` [PATCH 4/6] media/video: don't use flush_scheduled_work() Tejun Heo
2010-12-12 16:48 ` [PATCH 5/6] speedtch: don't abuse struct delayed_work Tejun Heo
2010-12-16 21:30 ` Greg KH
2010-12-17 11:05 ` Tejun Heo
2010-12-12 16:48 ` [PATCH 6/6] usb: don't use flush_scheduled_work() Tejun Heo
2010-12-17 13:51 ` speedtch: don't abuse struct delayed_work Nicolas Kaiser
2010-12-18 11:58 ` Nicolas Kaiser
2010-12-18 16:32 ` [PATCH UPDATED 5/6] " Tejun Heo
2010-12-18 17:59 ` Nicolas Kaiser
2010-12-24 15:14 ` [PATCHSET] workqueue: another assorted flush_scheduled_work() removals 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=1292172499-21633-2-git-send-email-tj@kernel.org \
--to=tj@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.