Skip to content

Commit a071b04

Browse files
Lai Jiangshanhtejun
authored andcommitted
workqueue: Remove useless pool->dying_workers
A dying worker is first moved from pool->workers to pool->dying_workers in set_worker_dying() and removed from pool->dying_workers in detach_dying_workers(). The whole procedure is in the some lock context of wq_pool_attach_mutex. So pool->dying_workers is useless, just remove it and keep the dying worker in pool->workers after set_worker_dying() and remove it in detach_dying_workers() with wq_pool_attach_mutex held. Cc: Valentin Schneider <[email protected]> Signed-off-by: Lai Jiangshan <[email protected]> Signed-off-by: Tejun Heo <[email protected]>
1 parent f4b7b53 commit a071b04

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

kernel/workqueue.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,6 @@ struct worker_pool {
215215

216216
struct worker *manager; /* L: purely informational */
217217
struct list_head workers; /* A: attached workers */
218-
struct list_head dying_workers; /* A: workers about to die */
219218

220219
struct ida worker_ida; /* worker IDs for task name */
221220

@@ -2862,7 +2861,6 @@ static void set_worker_dying(struct worker *worker, struct list_head *list)
28622861
worker->flags |= WORKER_DIE;
28632862

28642863
list_move(&worker->entry, list);
2865-
list_move(&worker->node, &pool->dying_workers);
28662864

28672865
/* get an extra task struct reference for later kthread_stop_put() */
28682866
get_task_struct(worker->task);
@@ -4721,7 +4719,6 @@ static int init_worker_pool(struct worker_pool *pool)
47214719
timer_setup(&pool->mayday_timer, pool_mayday_timeout, 0);
47224720

47234721
INIT_LIST_HEAD(&pool->workers);
4724-
INIT_LIST_HEAD(&pool->dying_workers);
47254722

47264723
ida_init(&pool->worker_ida);
47274724
INIT_HLIST_NODE(&pool->hash_node);

0 commit comments

Comments
 (0)