]> git.baikalelectronics.ru Git - kernel.git/commit
lockdep: fix workqueue creation API lockdep interaction
authorJohannes Berg <johannes@sipsolutions.net>
Wed, 16 Jan 2008 08:51:58 +0000 (09:51 +0100)
committerPeter Zijlstra <a.p.zijlstra@chello.nl>
Wed, 16 Jan 2008 08:51:58 +0000 (09:51 +0100)
commit4a015d0bc908b058409d5bfb9313ded4a14c965a
tree228bf4afa2c4418ad09cd50b3ebb762f793ed84a
parent2f389aa4536922971d45a3574d9dba498ff37c2a
lockdep: fix workqueue creation API lockdep interaction
Dave Young reported warnings from lockdep that the workqueue API
can sometimes try to register lockdep classes with the same key
but different names. This is not permitted in lockdep.

Unfortunately, I was unaware of that restriction when I wrote
the code to debug workqueue problems with lockdep and used the
workqueue name as the lockdep class name. This can obviously
lead to the problem if the workqueue name is dynamic.

This patch solves the problem by always using a constant name
for the workqueue's lockdep class, namely either the constant
name that was passed in or a string consisting of the variable
name.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
include/linux/workqueue.h
kernel/workqueue.c