Re: [PATCH 3/6] workqueue: release pwq pools by pool type

From: Tejun Heo

Date: Sun Aug 02 2026 - 20:32:03 EST


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?

> +/* 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?

Thanks.

--
tejun