Re: [PATCH v2] workqueue: Add pool_workqueue to pending_pwqs list when unplugging multiple inactive works

From: Matthew Brost

Date: Thu Apr 02 2026 - 00:25:54 EST


On Wed, Apr 01, 2026 at 10:20:13AM -1000, Tejun Heo wrote:
> Hello,
>
> Applied to wq/for-7.0-fixes with the comment updated as below.
>

+1 on commenr adjustment. Thanks for the quick pull.

Matt

> Thanks.
>
> --- a/kernel/workqueue.c
> +++ b/kernel/workqueue.c
> @@ -1852,12 +1852,11 @@
> if (pwq_activate_first_inactive(pwq, true)) {
> /*
> - * pwq is unbound. Additional inactive work_items need
> - * to reinsert the pwq into nna->pending_pwqs, which
> - * was skipped while pwq->plugged was true. See
> - * pwq_tryinc_nr_active() for additional details.
> + * While plugged, queueing skips activation which
> + * includes bumping the nr_active count and adding the
> + * pwq to nna->pending_pwqs if the count can't be
> + * obtained. We need to restore both for the pwq being
> + * unplugged. The first call activates the first
> + * inactive work item and the second, if there are more
> + * inactive, puts the pwq on pending_pwqs.
> */
>
> --
> tejun