Re: [PATCH 5/6] workqueue: add a per-cpu backend for unbound pwqs

From: Tejun Heo

Date: Sun Aug 02 2026 - 20:37:00 EST


Hello,

On Fri, Jul 31, 2026 at 04:57:37AM -0700, Breno Leitao wrote:
> Add alloc_percpu_pwq(), which binds a pwq to get_percpu_pool(wq, cpu),
> and an internal __WQ_PERCPU_POOLS flag. unbound_wq_update_pwq() installs
> such a pwq per CPU when the flag is set, reusing the existing
> install/drain path. Pool release and nr_active are already keyed on the
> backing pool, so a per-cpu-backed pwq is torn down and throttled
> correctly.
>
> PS: We can do this using if/else for per cpu/unbound as well, instead of
> this labels:, would it be better?

So, we would have percpu-pool backed unbound workqueues in addition to the
existing percpu workqueues? I'm not sure that makes sense. What prevents
unifying them?

Thanks.

--
tejun