Re: [PATCH V4 3/4] workqueue: Limit number of processed works in rescuer per turn
From: Tejun Heo
Date: Tue Dec 02 2025 - 13:16:29 EST
On Tue, Nov 25, 2025 at 02:36:16PM +0800, Lai Jiangshan wrote:
...
> + while (assign_rescuer_work(pwq, rescuer, ++count > RESCUER_BATCH))
> process_scheduled_works(rescuer);
Can we something like the following instead?
while (assign_rescuer_work(pwq, rescuer, &count))
It just feels odd to for the caller to decide "you should stop" and then
taking actions on the return value of the callee. Alternatively, just
separate out the pwq rotation into a separate function, so that the caller
can do
while (assign_rescuer_work(..)) {
process_scheduled_works(rescuer);
if (++count > RESCUER_BATCH) {
rotate mayday list;
break;
}
}
Thanks.
--
tejun