History

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.

Lai Jiangshan committed 11 months ago

Commit fc5ff531 parent c2f2b011 file · +3 −10Browse files

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

Unified · Split

kernel/workqueue.c+3−10
@@ -2976,9 +2976,8 @@ static void idle_cull_fn(struct work_struct *work) · 2975 unmodified lines
29762976 reap_dying_workers(&cull_list);
29772977 }
29782978
2979−static void send_mayday(struct work_struct *work)
2979+static void send_mayday(struct pool_workqueue *pwq)
29802980 {
2981− struct pool_workqueue *pwq = get_work_pwq(work);
29822981 struct workqueue_struct *wq = pwq->wq;
29832982
29842983 lockdep_assert_held(&wq_mayday_lock);
@@ -3016,7 +3015,7 @@ static void pool_mayday_timeout(struct timer_list *t) · 31 unmodified lines
30163015 * rescuers.
30173016 */
30183017 list_for_each_entry(work, &pool->worklist, entry)
3019− send_mayday(work);
3018+ send_mayday(get_work_pwq(work));
30203019 }
30213020
30223021 raw_spin_unlock(&wq_mayday_lock);
@@ -3538,13 +3537,7 @@ repeat: · 515 unmodified lines
35383537 */
35393538 if (pwq->nr_active && need_to_create_worker(pool)) {
35403539 raw_spin_lock(&wq_mayday_lock);
3541− /*
3542− * Queue iff somebody else hasn't queued it already.
3543− */
3544− if (list_empty(&pwq->mayday_node)) {
3545− get_pwq(pwq);
3546− list_add_tail(&pwq->mayday_node, &wq->maydays);
3547− }
3540+ send_mayday(pwq);
35483541 raw_spin_unlock(&wq_mayday_lock);
35493542 }
35503543 }