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

Breno Leitao posted 5 patches 1 month, 1 week ago
kernel/workqueue.c | 157 ++++++++++++++++++++++++-----------------------------
1 file changed, 72 insertions(+), 85 deletions(-)
[PATCH 0/5] workqueue: unify percpu and unbound pwq allocation
Posted by Breno Leitao 1 month, 1 week ago
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@debian.org>
---
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@debian.org>
Re: [PATCH 0/5] workqueue: unify percpu and unbound pwq allocation
Posted by Tejun Heo 3 weeks, 6 days ago
Hello,

On Wed, Aug 19, 2026 at 07:37:34AM -0700, Breno Leitao wrote:
> 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

Applied 1-3 to wq/for-7.4.

Thanks.

-- 
tejun