History

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.

Tejun Heo committed 2 years ago

Commit 6a229b01 parent 8318d6a1 file · +2 −3Browse files

Showing the changes to kernel/workqueue.c (1 of 1 file). Show all

Unified · Split

kernel/workqueue.c+2−3
@@ -2217,12 +2217,11 @@ static struct worker *create_worker(struct worker_pool *pool) · 2216 unmodified lines
2217 2217
2218 worker->pool->nr_workers++;2218 worker->pool->nr_workers++;
2219 worker_enter_idle(worker);2219 worker_enter_idle(worker);
2220 kick_pool(pool);
2221 2220
2222 /*2221 /*
2223 * @worker is waiting on a completion in kthread() and will trigger hung2222 * @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 it2223 * check if not woken up soon. As kick_pool() is noop if @pool is empty,
2225 * up, wake it up explicitly once more.2224 * wake it up explicitly.
2226 */2225 */
2227 wake_up_process(worker->task);2226 wake_up_process(worker->task);
2228 2227

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t