[PATCH 6/6] workqueue: install per-cpu pwqs at creation for __WQ_PERCPU_POOLS
From: Breno Leitao
Date: Fri Jul 31 2026 - 08:00:38 EST
alloc_and_link_pwqs() brings up an unbound workqueue with dedicated
unbound pools. For a workqueue that requests the per-cpu backend,
convert those pwqs to per-cpu-backed ones right after creation by
running the per-CPU update, so the backend is in place before the
workqueue is used rather than only after the first CPU hotplug event.
No workqueue sets __WQ_PERCPU_POOLS yet, so there is no functional
change.
Signed-off-by: Breno Leitao <leitao@xxxxxxxxxx>
---
kernel/workqueue.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index df4fc9ccb7b22..cd3d0d54dfddc 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -5766,6 +5766,12 @@ static int alloc_and_link_pwqs(struct workqueue_struct *wq)
if (ret)
goto enomem;
+
+ if (wq->flags & __WQ_PERCPU_POOLS) {
+ for_each_possible_cpu(cpu)
+ unbound_wq_update_pwq(wq, cpu);
+ }
+
return 0;
enomem:
--
2.53.0-Meta