workqueue: Update lock debugging code
authorTejun Heo <tj@kernel.org>
Sun, 4 Feb 2024 21:28:06 +0000 (11:28 -1000)
committerTejun Heo <tj@kernel.org>
Sun, 4 Feb 2024 21:28:06 +0000 (11:28 -1000)
commitc35aea39d1e106f61fd2130f0d32a3bac8bd4570
tree1a937c06f9e50d76b2133c98810d21e2fcd97c3e
parentd412ace11144aa2bf692c7cf9778351efc15c827
workqueue: Update lock debugging code

These changes are in preparation of BH workqueue which will execute work
items from BH context.

- Update lock and RCU depth checks in process_one_work() so that it
  remembers and checks against the starting depths and prints out the depth
  changes.

- Factor out lockdep annotations in the flush paths into
  touch_{wq|work}_lockdep_map(). The work->lockdep_map touching is moved
  from __flush_work() to its callee - start_flush_work(). This brings it
  closer to the wq counterpart and will allow testing the associated wq's
  flags which will be needed to support BH workqueues. This is not expected
  to cause any functional changes.

Signed-off-by: Tejun Heo <tj@kernel.org>
Tested-by: Allen Pais <allen.lkml@gmail.com>
kernel/workqueue.c