[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20211223123140.3789-4-jiangshanlai@gmail.com>
Date: Thu, 23 Dec 2021 20:31:39 +0800
From: Lai Jiangshan <jiangshanlai@...il.com>
To: linux-kernel@...r.kernel.org, Tejun Heo <tj@...nel.org>
Cc: Lai Jiangshan <laijs@...ux.alibaba.com>,
Lai Jiangshan <jiangshanlai@...il.com>
Subject: [PATCH 3/4] workqueue: Use wake_up_worker() in wq_worker_sleeping() instead of open code
From: Lai Jiangshan <laijs@...ux.alibaba.com>
The wakeup code in wq_worker_sleeping() is the same as wake_up_worker().
Signed-off-by: Lai Jiangshan <laijs@...ux.alibaba.com>
---
kernel/workqueue.c | 9 +++------
1 file 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);
}
--
2.19.1.6.gb485710b
Powered by blists - more mailing lists