summaryrefslogtreecommitdiff
path: root/kernel/mutex-debug.h
diff options
context:
space:
mode:
authorLai Jiangshan <laijs@cn.fujitsu.com>2013-07-24 10:31:42 (GMT)
committerTejun Heo <tj@kernel.org>2013-07-24 16:24:25 (GMT)
commitc2fda509667b0fda4372a237f5a59ea4570b1627 (patch)
tree27ba4e2f32cdd58e2f6f2cfa694f25afe7020e35 /kernel/mutex-debug.h
parentad81f0545ef01ea651886dddac4bef6cec930092 (diff)
downloadlinux-fsl-qoriq-c2fda509667b0fda4372a237f5a59ea4570b1627.tar.xz
workqueue: allow work_on_cpu() to be called recursively
If the @fn call work_on_cpu() again, the lockdep will complain: > [ INFO: possible recursive locking detected ] > 3.11.0-rc1-lockdep-fix-a #6 Not tainted > --------------------------------------------- > kworker/0:1/142 is trying to acquire lock: > ((&wfc.work)){+.+.+.}, at: [<ffffffff81077100>] flush_work+0x0/0xb0 > > but task is already holding lock: > ((&wfc.work)){+.+.+.}, at: [<ffffffff81075dd9>] process_one_work+0x169/0x610 > > other info that might help us debug this: > Possible unsafe locking scenario: > > CPU0 > ---- > lock((&wfc.work)); > lock((&wfc.work)); > > *** DEADLOCK *** It is false-positive lockdep report. In this sutiation, the two "wfc"s of the two work_on_cpu() are different, they are both on stack. flush_work() can't be deadlock. To fix this, we need to avoid the lockdep checking in this case, thus we instroduce a internal __flush_work() which skip the lockdep. tj: Minor comment adjustment. Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com> Reported-by: "Srivatsa S. Bhat" <srivatsa.bhat@linux.vnet.ibm.com> Reported-by: Alexander Duyck <alexander.h.duyck@intel.com> Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'kernel/mutex-debug.h')
0 files changed, 0 insertions, 0 deletions