Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

workqueue: Make send_mayday() take a PWQ argument directly

Make send_mayday() operate on a PWQ directly instead of taking a work
item, so that rescuer_thread() now calls send_mayday(pwq) instead of
open-coding the mayday list manipulation.

Signed-off-by: Lai Jiangshan <jiangshan.ljs@antgroup.com>
Signed-off-by: Tejun Heo <tj@kernel.org>

authored by

Lai Jiangshan and committed by
Tejun Heo
fc5ff53d c2f2b01b

+3 -10
+3 -10
kernel/workqueue.c
··· 2976 2976 reap_dying_workers(&cull_list); 2977 2977 } 2978 2978 2979 - static void send_mayday(struct work_struct *work) 2979 + static void send_mayday(struct pool_workqueue *pwq) 2980 2980 { 2981 - struct pool_workqueue *pwq = get_work_pwq(work); 2982 2981 struct workqueue_struct *wq = pwq->wq; 2983 2982 2984 2983 lockdep_assert_held(&wq_mayday_lock); ··· 3015 3016 * rescuers. 3016 3017 */ 3017 3018 list_for_each_entry(work, &pool->worklist, entry) 3018 - send_mayday(work); 3019 + send_mayday(get_work_pwq(work)); 3019 3020 } 3020 3021 3021 3022 raw_spin_unlock(&wq_mayday_lock); ··· 3537 3538 */ 3538 3539 if (pwq->nr_active && need_to_create_worker(pool)) { 3539 3540 raw_spin_lock(&wq_mayday_lock); 3540 - /* 3541 - * Queue iff somebody else hasn't queued it already. 3542 - */ 3543 - if (list_empty(&pwq->mayday_node)) { 3544 - get_pwq(pwq); 3545 - list_add_tail(&pwq->mayday_node, &wq->maydays); 3546 - } 3541 + send_mayday(pwq); 3547 3542 raw_spin_unlock(&wq_mayday_lock); 3548 3543 } 3549 3544 }