mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-04-01 03:54:02 +00:00
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>
This commit is contained in:
parent
2c1f1a9180
commit
cc5bff3846
1 changed files with 3 additions and 6 deletions
|
@ -887,7 +887,7 @@ void wq_worker_running(struct task_struct *task)
|
||||||
*/
|
*/
|
||||||
void wq_worker_sleeping(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;
|
struct worker_pool *pool;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -918,11 +918,8 @@ void wq_worker_sleeping(struct task_struct *task)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (atomic_dec_and_test(&pool->nr_running) &&
|
if (atomic_dec_and_test(&pool->nr_running) &&
|
||||||
!list_empty(&pool->worklist)) {
|
!list_empty(&pool->worklist))
|
||||||
next = first_idle_worker(pool);
|
wake_up_worker(pool);
|
||||||
if (next)
|
|
||||||
wake_up_process(next->task);
|
|
||||||
}
|
|
||||||
raw_spin_unlock_irq(&pool->lock);
|
raw_spin_unlock_irq(&pool->lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue