diff options
author | Lai Jiangshan <jiangshan.ljs@antgroup.com> | 2024-06-21 09:32:25 +0200 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2024-06-22 00:34:02 +0200 |
commit | a071b043ab13ae1f5d12ba6f267936feb800dff8 (patch) | |
tree | b55224e85b15f9f9438feebc1ac9ff893372f3ef /kernel/workqueue.c | |
parent | workqueue: Detach workers directly in idle_cull_fn() (diff) | |
download | linux-a071b043ab13ae1f5d12ba6f267936feb800dff8.tar.xz linux-a071b043ab13ae1f5d12ba6f267936feb800dff8.zip |
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 <vschneid@redhat.com>
Signed-off-by: Lai Jiangshan <jiangshan.ljs@antgroup.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'kernel/workqueue.c')
-rw-r--r-- | kernel/workqueue.c | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/kernel/workqueue.c b/kernel/workqueue.c index 04168972814b..adf1893b161e 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c @@ -215,7 +215,6 @@ struct worker_pool { struct worker *manager; /* L: purely informational */ struct list_head workers; /* A: attached workers */ - struct list_head dying_workers; /* A: workers about to die */ struct ida worker_ida; /* worker IDs for task name */ @@ -2862,7 +2861,6 @@ static void set_worker_dying(struct worker *worker, struct list_head *list) worker->flags |= WORKER_DIE; list_move(&worker->entry, list); - list_move(&worker->node, &pool->dying_workers); /* get an extra task struct reference for later kthread_stop_put() */ get_task_struct(worker->task); @@ -4721,7 +4719,6 @@ static int init_worker_pool(struct worker_pool *pool) timer_setup(&pool->mayday_timer, pool_mayday_timeout, 0); INIT_LIST_HEAD(&pool->workers); - INIT_LIST_HEAD(&pool->dying_workers); ida_init(&pool->worker_ida); INIT_HLIST_NODE(&pool->hash_node); |