Johannes Berg 4e6045f134 workqueue: debug flushing deadlocks with lockdep
In the following scenario:

code path 1:
  my_function() -> lock(L1); ...; flush_workqueue(); ...

code path 2:
  run_workqueue() -> my_work() -> ...; lock(L1); ...

you can get a deadlock when my_work() is queued or running
but my_function() has acquired L1 already.

This patch adds a pseudo-lock to each workqueue to make lockdep
warn about this scenario.

[akpm@linux-foundation.org: coding-style fixes]
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Acked-by: Oleg Nesterov <oleg@tv-sign.ru>
Acked-by: Ingo Molnar <mingo@elte.hu>
Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-10-19 11:53:38 -07:00
..
2007-10-19 11:53:34 -07:00
2007-10-19 11:53:34 -07:00
2007-10-19 11:53:34 -07:00
2007-10-18 14:37:29 -07:00
2007-10-19 11:53:34 -07:00
2007-10-19 11:53:34 -07:00
2007-10-19 11:53:34 -07:00
2007-10-19 11:53:34 -07:00
2007-10-19 11:53:34 -07:00
2007-10-19 11:53:34 -07:00
2007-10-19 11:53:34 -07:00
2007-10-19 11:53:34 -07:00
2007-10-19 11:53:34 -07:00
2007-10-19 11:53:34 -07:00
2007-08-18 17:15:17 -07:00
2007-10-16 16:57:46 +02:00