Re: [PATCH V3 7/7] workqueue: Process extra works in rescuer when there are no more to rescue
From: Tejun Heo
Date: Sat Nov 22 2025 - 09:31:54 EST
Hello,
On Sat, Nov 22, 2025 at 03:07:25PM +0800, Lai Jiangshan wrote:
...
> But this patch does not really check if memory pressure is still on,
> using (pool->flags & POOL_MANAGER_ACTIVE) can kind of
> achieve it, though not precisely. There is never a precise way,
> but the system has poured some resources to create the rescuer,
> it is better to make the best use of it, like before patch 2/7.
>
> this patch:
> if (!pwq->nr_active)
> return false;
> if (!need_to_create_worker(pool)) {
> if (limited || !list_empty(&pwq->wq->maydays))
> return false;
> }
>
> with memory pressure test via POOL_MANAGER_ACTIVE:
>
> if (!pwq->nr_active)
> return false;
> if (!need_to_create_worker(pool)) {
> if (limited || !(pool->flags & POOL_MANAGER_ACTIVE) ||
> !list_empty(&pwq->wq->maydays))
> return false;
> }
>
> What do you think?
Yeah, POOL_MANAGER_ACTIVE seems like a more reliable condition to test.
Let's do that.
Thanks.
--
tejun