workqueue: mark lock acquisition on worker_maybe_bind_and_lock()
authorNamhyung Kim <namhyung@gmail.com>
Sun, 22 Aug 2010 14:19:43 +0000 (23:19 +0900)
committerTejun Heo <tj@kernel.org>
Mon, 23 Aug 2010 09:37:49 +0000 (11:37 +0200)
worker_maybe_bind_and_lock() actually grabs gcwq->lock but was missing proper
annotation. Add it. So this patch will remove following sparse warnings:

 kernel/workqueue.c:1214:13: warning: context imbalance in 'worker_maybe_bind_and_lock' - wrong count at exit
 arch/x86/include/asm/irqflags.h:44:9: warning: context imbalance in 'worker_rebind_fn' - unexpected unlock
 kernel/workqueue.c:1991:17: warning: context imbalance in 'rescuer_thread' - unexpected unlock

Signed-off-by: Namhyung Kim <namhyung@gmail.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
kernel/workqueue.c

index 7415f27a8aa73a69c0c325d62412d521b012b1ec..cc3456f96c56ab5816bfc5e4a367db7d3f8a40d9 100644 (file)
@@ -1212,6 +1212,7 @@ static void worker_leave_idle(struct worker *worker)
  * bound), %false if offline.
  */
 static bool worker_maybe_bind_and_lock(struct worker *worker)
+__acquires(&gcwq->lock)
 {
        struct global_cwq *gcwq = worker->gcwq;
        struct task_struct *task = worker->task;