Commit 92b69f50 authored by Lai Jiangshan's avatar Lai Jiangshan Committed by Tejun Heo

workqueue: sanity check pool->cpu in wq_worker_sleeping()

In theory, pool->cpu is equals to @cpu in wq_worker_sleeping() after
worker->flags is checked.

And "pool->cpu != cpu" sanity check will help us if something wrong.
Signed-off-by: default avatarLai Jiangshan <laijs@cn.fujitsu.com>
Signed-off-by: default avatarTejun Heo <tj@kernel.org>
parent b62c0751
...@@ -843,7 +843,7 @@ struct task_struct *wq_worker_sleeping(struct task_struct *task, int cpu) ...@@ -843,7 +843,7 @@ struct task_struct *wq_worker_sleeping(struct task_struct *task, int cpu)
pool = worker->pool; pool = worker->pool;
/* this can only happen on the local cpu */ /* this can only happen on the local cpu */
if (WARN_ON_ONCE(cpu != raw_smp_processor_id())) if (WARN_ON_ONCE(cpu != raw_smp_processor_id() || pool->cpu != cpu))
return NULL; return NULL;
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment