Skip to content

Commit 6a229b0

Browse files
committed
workqueue: Drop unnecessary kick_pool() in create_worker()
After creating a new worker, create_worker() is calling kick_pool() to wake up the new worker task. However, as kick_pool() doesn't do anything if there is no work pending, it also calls wake_up_process() explicitly. There's no reason to call kick_pool() at all. wake_up_process() is enough by itself. Drop the unnecessary kick_pool() call. Signed-off-by: Tejun Heo <tj@kernel.org>
1 parent 8318d6a commit 6a229b0

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

kernel/workqueue.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2217,12 +2217,11 @@ static struct worker *create_worker(struct worker_pool *pool)
22172217

22182218
worker->pool->nr_workers++;
22192219
worker_enter_idle(worker);
2220-
kick_pool(pool);
22212220

22222221
/*
22232222
* @worker is waiting on a completion in kthread() and will trigger hung
2224-
* check if not woken up soon. As kick_pool() might not have waken it
2225-
* up, wake it up explicitly once more.
2223+
* check if not woken up soon. As kick_pool() is noop if @pool is empty,
2224+
* wake it up explicitly.
22262225
*/
22272226
wake_up_process(worker->task);
22282227

0 commit comments

Comments
 (0)