aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/workqueue.c
diff options
context:
space:
mode:
authorJoonsoo Kim <js1304@gmail.com>2012-10-26 10:03:49 -0400
committerTejun Heo <tj@kernel.org>2012-12-01 19:45:45 -0500
commit3657600040a7279e52252af3f9d7e253f4f49ef0 (patch)
tree1cc95124c9108e24ee18a7d9af2e511fd735daae /kernel/workqueue.c
parent999767beb1b4a10eabf90e6017e496536cf4db0b (diff)
workqueue: add WARN_ON_ONCE() on CPU number to wq_worker_waking_up()
Recently, workqueue code has gone through some changes and we found some bugs related to concurrency management operations happening on the wrong CPU. When a worker is concurrency managed (!WORKER_NOT_RUNNIG), it should be bound to its associated cpu and woken up to that cpu. Add WARN_ON_ONCE() to verify this. Signed-off-by: Joonsoo Kim <js1304@gmail.com> Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'kernel/workqueue.c')
-rw-r--r--kernel/workqueue.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index 26f5d16aef65..ae9a05603e01 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -739,8 +739,10 @@ void wq_worker_waking_up(struct task_struct *task, unsigned int cpu)
739{ 739{
740 struct worker *worker = kthread_data(task); 740 struct worker *worker = kthread_data(task);
741 741
742 if (!(worker->flags & WORKER_NOT_RUNNING)) 742 if (!(worker->flags & WORKER_NOT_RUNNING)) {
743 WARN_ON_ONCE(worker->pool->gcwq->cpu != cpu);
743 atomic_inc(get_pool_nr_running(worker->pool)); 744 atomic_inc(get_pool_nr_running(worker->pool));
745 }
744} 746}
745 747
746/** 748/**