lkml.org 
[lkml]   [2009]   [Jan]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 2/3] workqueue: not allow recursion run_workqueue
From
Date
On Thu, 2009-01-22 at 12:06 +0100, Frédéric Weisbecker wrote:

> Ok.
> Oh but I haven't seen that Oleg said he prefered bug_on, because the
> system will deadlock instead....hmm...
>
> Or perhaps keeping the things like the old way, but with a WARN_ONCE:
>
> if (cwq->thread == current) {
> /*
> * Don't ever think to flush workqueue from a work
> */
> WARN_ONCE(1);
>
> run_workqueue(cwq);
> active = 1;
> }
>
> And then, the workqueue will flush...so it will behave correctly but
> will warn on this bad developer idea of flushing from a work.

lockdep already yells at you for doing that, and developers should run
with lockdep enabled -- or at least test stuff with lockdep enabled, so
I'm not exactly seeing what this will buy us.

> Actually I don't understand when Lai says that it will actually not flush.

Yeah, his changelog is an utter mistery to many..

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2009-01-22 12:13    [W:0.388 / U:0.364 seconds]
©2003-2014 Jasper Spaans. Advertise on this site