Re: [PATCH 3/6] workqueue: release pwq pools by pool type
From: Breno Leitao
Date: Mon Aug 03 2026 - 11:40:58 EST
On Sun, Aug 02, 2026 at 02:31:27PM -1000, Tejun Heo wrote:
> On Fri, Jul 31, 2026 at 04:57:35AM -0700, Breno Leitao wrote:
> > pwq_release_workfn() calls put_unbound_pool() based on the WQ_UNBOUND
> > flag. That works today because an unbound workqueue only ever points at
> > unbound pools, but the flag is the wrong thing to test: what matters is
> > whether the pool is a refcounted unbound pool or a permanent per-cpu one.
> >
> > Add is_pool_cpu_specific() and key the release on it instead of the flag.
> > This is equivalent for every existing workqueue and stays correct if an
> > unbound pwq is ever backed by a per-cpu pool. Convert the other
> > open-coded pool->cpu type checks -- in put_unbound_pool(),
> > pool_allowed_cpus() and the workqueue watchdog -- to the same helper.
> >
> > No functional change.
>
> The first para saying that it's testing something wrong and then the patch
> not having any functional change reads odd. Can you please rewrite?
Fair, I meant that the two conditions agree today and nothing changes
here. I will get this better.
> > +/* True if @pool is tied to a specific CPU, rather than an unbound
> > pool. */ +static bool is_pool_cpu_specific(struct worker_pool *pool)
>
> I'm not sure about introducing a new term. Can we just stick to
> percpu?
Sure -- is_percpu_pool() any better?
Thanks,
--breno