]> Git Repo - J-linux.git/commitdiff
workqueue: Use wake_up_worker() in wq_worker_sleeping() instead of open code
authorLai Jiangshan <[email protected]>
Thu, 23 Dec 2021 12:31:39 +0000 (20:31 +0800)
committerTejun Heo <[email protected]>
Wed, 12 Jan 2022 17:40:32 +0000 (07:40 -1000)
The wakeup code in wq_worker_sleeping() is the same as wake_up_worker().

Signed-off-by: Lai Jiangshan <[email protected]>
Signed-off-by: Tejun Heo <[email protected]>
kernel/workqueue.c

index b3207722671cc55cb8a9a253f9b60f6785852001..69cbe9e62bf1bc0141637550e803e441f5a71eb5 100644 (file)
@@ -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);
 }
 
This page took 0.049999 seconds and 4 git commands to generate.