[PATCH 0/5] workqueue: unify percpu and unbound pwq allocation

From: Breno Leitao

Date: Wed Aug 19 2026 - 10:37:57 EST


Per-cpu and unbound workqueues built their pwqs differently. This series
deletes alloc_and_link_percpu_pwqs() and sends per-cpu workqueues
through the apply_wqattrs_prepare() and apply_wqattrs_commit() path
unbound workqueues already use.

Now the branchj is alloc_pwq(), depending if we want a WQ_PERCPU or
UNBOUND workqueue.

The percpu affinity scope question is not answered yet: the backing
still comes from wq->flags, not the attrs, so nothing switches at
runtime.

This is one step closer, a pwq can now point at either pool.

Next is a WQ_AFFN_PERCPU scope that says the pools are per-cpu and
concurrency managed.

Then workqueue internals, such as alloc_pwq(), takes the backing from
the attrs, not from wq->flags, and WQ_PERCPU becomes a user-facing flag
only (?!)

PS: These changes make workqueue code -13 lines shorter.

Signed-off-by: Breno Leitao <leitao@xxxxxxxxxx>
---
Breno Leitao (5):
workqueue: move the unbound-only attrs check to apply_workqueue_attrs()
workqueue: resolve the backing pool in alloc_pwq()
workqueue: make the default pwq optional
workqueue: build percpu pwqs through the attrs path
workqueue: rename the pwq slot helpers shared with percpu

kernel/workqueue.c | 157 ++++++++++++++++++++++++-----------------------------
1 file changed, 72 insertions(+), 85 deletions(-)
---
base-commit: 4477a78374a57c3809b172ad30cceabda48c47c6
change-id: 20260817-wq_realsplit-86edfe9e7884

Best regards,
--
Breno Leitao <leitao@xxxxxxxxxx>