workqueue: insert warn_on_once() into wq_worker_waking_up()
PATCH 1/1 workqueue: insert warn_on_once() into wq_worker_waking_up()
Recently, workqueue code has gone through some changes and we found some bugs related to this. To prevent futher bugs in advance, add WARN_ON_ONCE() in wq_worker_waking_up(). When worker is not WORKER_NOT_RUNNIG state, it should be binded to it's associated cpu and executed in that cpu. Add code for checking this.
kernel/workqueue.c +3 -1
@@ -739,8 +739,10 @@ void wq_worker_waking_up(struct task_struct *task, unsigned int cpu) {struct worker *worker =kthread_data (task); -if (!(worker->flags &WORKER_NOT_RUNNING )) +if (!(worker->flags &WORKER_NOT_RUNNING )) { +WARN_ON_ONCE (worker->pool->gcwq->cpu != cpu);atomic_inc (get_pool_nr_running (worker->pool)); + } }/**
Signature · 1 line
1.7.9.5
Quoted 7 lines · Joonsoo Kim
Recently, workqueue code has gone through some changes and we found some bugs related to this. To prevent futher bugs in advance, add
WARN_ON_ONCE()inwq_worker_waking_up(). When worker is notWORKER_NOT_RUNNIGstate, it should be binded to it's associated cpu and executed in that cpu. Add code for checking this.Signed-off-by Joonsoo Kim <[email protected]>
Applied to wq/for-3.8 w/ some commit message updates.
Thanks.
Signature · 1 line
tejun