Re: [PATCH V4 1/4] workqueue: Loop over in rescuer until all its work is done

From: Tejun Heo

Date: Tue Dec 02 2025 - 13:07:37 EST


On Tue, Nov 25, 2025 at 02:36:14PM +0800, Lai Jiangshan wrote:
> From: Lai Jiangshan <jiangshan.ljs@xxxxxxxxxxxx>
>
> Simplify the rescuer work by looping directly in the rescuer rather than
> adding the pwq back to the maydays list. This also helps when
> max_requests is 1 or small but pwq->inactive_works has a large number of
> pending work items.
>
> This might hurt fairness among PWQs and the rescuer could end up being
> stuck on one PWQ indefinitely, but the rescuer's objective is to make
> forward progress rather than ensure fairness.
>
> Fairness can be further improved in future by assigning work items to
> the rescuer one by one and this is a temporary change to ease the
> transition.

Again, I'd just note that this is temporary removal rather than trying
justify that fairness doesn't matter because I think it does (not in terms
of theoretical correctness but in the practical approach of avoiding
unnecessary surprises) and the behavior is restored by a later patch.

Thanks.

--
tejun