Re: [PATCH v2] workqueue: Add pool_workqueue to pending_pwqs list when unplugging multiple inactive works
From: Tejun Heo
Date: Wed Apr 01 2026 - 16:22:23 EST
Hello,
Applied to wq/for-7.0-fixes with the comment updated as below.
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