Re: [PATCH 1/2] workqueue: debug flushing deadlocks with lockdep

2007-07-06 Thread Johannes Berg
On Thu, 2007-07-05 at 18:52 +0400, Oleg Nesterov wrote: > So I agree with you, such recursion is indeed bad. Can we forbid this? > In that case this patch is even more perfect :) I haven't seen it complain in a few days so that probably means such usage is rather rare :) johannes signature.asc

Re: [PATCH 1/2] workqueue: debug flushing deadlocks with lockdep

2007-07-05 Thread Oleg Nesterov
On 07/05, Ingo Molnar wrote: > > * Oleg Nesterov <[EMAIL PROTECTED]> wrote: > > > OTOH. Perhaps we can can forbid such a behaviour? Andrew, do you know > > any good example of "keventd trying to flush its own queue" ? > > i'd prefer to make the API a little bit stricter: such recursion is > na

Re: [PATCH 1/2] workqueue: debug flushing deadlocks with lockdep

2007-07-05 Thread Ingo Molnar
* Oleg Nesterov <[EMAIL PROTECTED]> wrote: > Currently it is allowed that work->func() does flush_workqueue() on > its own workqueue. So we have > > run_workqueue() > work->func() > flush_workqueue() > run_workqueue() > >

Re: [PATCH 1/2] workqueue: debug flushing deadlocks with lockdep

2007-07-05 Thread Oleg Nesterov
On 07/05, Johannes Berg wrote: > > @@ -257,7 +261,9 @@ static void run_workqueue(struct cpu_wor > > BUG_ON(get_wq_data(work) != cwq); > work_clear_pending(work); > + lock_acquire(&cwq->wq->lockdep_map, 0, 0, 0, 2, _THIS_IP_); > f(work); > +