summaryrefslogtreecommitdiff
path: root/kernel/workqueue.c
diff options
context:
space:
mode:
authorLai Jiangshan <laijs@linux.alibaba.com>2021-12-23 15:31:39 +0300
committerTejun Heo <tj@kernel.org>2022-01-12 20:40:32 +0300
commitcc5bff38463e0894dd596befa99f9d6860e15f5e (patch)
tree461d1562544cfc1595fec1c678c04ec0a9565bd6 /kernel/workqueue.c
parent2c1f1a9180bfacbc3c8e5b10075640cc810cf9c0 (diff)
downloadlinux-cc5bff38463e0894dd596befa99f9d6860e15f5e.tar.xz
workqueue: Use wake_up_worker() in wq_worker_sleeping() instead of open code
The wakeup code in wq_worker_sleeping() is the same as wake_up_worker(). Signed-off-by: Lai Jiangshan <laijs@linux.alibaba.com> Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'kernel/workqueue.c')
-rw-r--r--kernel/workqueue.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index b3207722671c..69cbe9e62bf1 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -887,7 +887,7 @@ void wq_worker_running(struct task_struct *task)
*/
void wq_worker_sleeping(struct task_struct *task)
{
- struct worker *next, *worker = kthread_data(task);
+ struct worker *worker = kthread_data(task);
struct worker_pool *pool;
/*
@@ -918,11 +918,8 @@ void wq_worker_sleeping(struct task_struct *task)
}
if (atomic_dec_and_test(&pool->nr_running) &&
- !list_empty(&pool->worklist)) {
- next = first_idle_worker(pool);
- if (next)
- wake_up_process(next->task);
- }
+ !list_empty(&pool->worklist))
+ wake_up_worker(pool);
raw_spin_unlock_irq(&pool->lock);
}