Re: [PATCH 4/6] workqueue: account nr_active by the backing pool

From: Breno Leitao

Date: Mon Aug 03 2026 - 10:45:22 EST


On Sun, Aug 02, 2026 at 02:34:16PM -1000, Tejun Heo wrote:
> Hello,
>
> On Fri, Jul 31, 2026 at 04:57:36AM -0700, Breno Leitao wrote:
> > @@ -1796,6 +1799,10 @@ static bool pwq_tryinc_nr_active(struct pool_workqueue *pwq, bool fill)
> > if (unlikely(pwq->plugged))
> > return false;
> >
> > + nna = wq_node_nr_active(wq, pool->node);
> > + if (WARN_ON_ONCE(!nna))
> > + return false;
>
> Would it make sense to turn WQ_UNBOUND test in wq_node_nr_active() into a
> WARN_ON_ONCE()? And I don't think the return value needs a null check.

Yes, that's the right place for it. wq->node_nr_active[] is only makes
sense for WQ_UNBOUND, so a NULL return was always a caller bug rather than an
answer.

I will improve it on v2.