* avoiding run_workqueue() recursion
@ 2009-07-14 4:45 Anirban Sinha
0 siblings, 0 replies; only message in thread
From: Anirban Sinha @ 2009-07-14 4:45 UTC (permalink / raw)
To: Andrew Morton; +Cc: linux-kernel
Hi Andrew:
I had a question about one of your previous commits:
: commit 2355b70fd59cb5be7de2052a9edeee7afb7ff099
: Author: Lai Jiangshan <laijs@cn.fujitsu.com>
: Date: Thu Apr 2 16:58:24 2009 -0700
:
: workqueue: avoid recursion in run_workqueue()
http://git.kernel.org/linus/2355b70fd59cb5be7de2052a9edeee7afb7ff099
I saw a few discussions on the mailing list around this. I also did see
your "I still don't know why I merged ..." comment on this. I have the
following observations. I am new in the kernel hacking world, so please
bear with me.
(a) I do agree that flushing the work queues from within run_workqueue()
is buggy in itself.
(b) I do also agree that recursive call to run_workqueue() is bad due to
the reasons cited in the commit log (even though I had a good laugh when
I saw the "morton gets to eat his hat" stuff :)).
(c) I am a little puzzled by the change the patch made. If we let the
call sleep on completion when keventd is itself running the
flush_workqueue(), are we not introducing a deadlock? If the thread that
is itself is responsible for walking the workqueue and dispatching the
work functions goes to sleep, who will wake it up?
In my honest opinion, I think we should simply return when (cwq->thread
== current) is true. I think in that condition, it should be just a
nop.
Please let me know what you think.
cheers,
ani
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2009-07-14 5:00 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-07-14 4:45 avoiding run_workqueue() recursion Anirban Sinha
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®