Re: [PATCH 3/5] workqueue: make the default pwq optional
From: Marco Crivellari
Date: Wed Aug 26 2026 - 04:23:14 EST
Hi Breno,
On Wed, Aug 19, 2026 at 4:37 PM Breno Leitao <leitao@xxxxxxxxxx> wrote:
>
> apply_wqattrs_prepare() always creates a dfl_pwq, the fallback a CPU
> uses when it has no pwq of its own. This is a CPU unbound field, so, we
> don't need it for the per cpu affinity version of workqueue.
>
> A percpu workqueue has no use for one. Skip the allocation for
> a WQ_PERCPU workqueue and skip installing what was not allocated.
What do you think about factoring this code out into a new function?
So that it can later be called also when a CPU (with the "preferred
percpu" flag set) is isolated through cgroup. I guess the dfl_pwq
should be allocated / freed accordingly (?)
Hope this makes sense.
Thanks!
--
Marco Crivellari
SUSE Labs