Re: [PATCH 3/5] workqueue: make the default pwq optional
From: Breno Leitao
Date: Wed Aug 26 2026 - 12:38:45 EST
On Wed, Aug 26, 2026 at 10:22:52AM +0200, Marco Crivellari wrote:
> 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 (?)
Makes sense as a direction: once a percpu workqueue loses a CPU it needs
somewhere to send that CPU's work, and after this patch it has no
dfl_pwq to fall back to.
Thanks for the review,
--breno