From: Tejun Heo <tj@kernel.org>
To: Lai Jiangshan <jiangshanlai@gmail.com>
Cc: linux-kernel@vger.kernel.org, ying chen <yc1082463@gmail.com>,
Lai Jiangshan <jiangshan.ljs@antgroup.com>
Subject: Re: [PATCH V4 3/4] workqueue: Limit number of processed works in rescuer per turn
Date: Tue, 2 Dec 2025 08:16:20 -1000 [thread overview]
Message-ID: <aS8s9ESMrbeTu_Zd@slm.duckdns.org> (raw)
In-Reply-To: <20251125063617.671199-4-jiangshanlai@gmail.com>
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
next prev parent reply other threads:[~2025-12-02 18:16 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-25 6:36 [PATCH V4 0/4] workqueue: Factor the way to assign rescuer work Lai Jiangshan
2025-11-25 6:36 ` [PATCH V4 1/4] workqueue: Loop over in rescuer until all its work is done Lai Jiangshan
2025-12-02 18:07 ` Tejun Heo
2025-11-25 6:36 ` [PATCH V4 2/4] workqueue: Process rescuer work items one-by-one using a cursor Lai Jiangshan
2025-11-25 6:36 ` [PATCH V4 3/4] workqueue: Limit number of processed works in rescuer per turn Lai Jiangshan
2025-12-02 18:16 ` Tejun Heo [this message]
2025-12-03 3:22 ` Lai Jiangshan
2025-12-03 19:41 ` Tejun Heo
2025-11-25 6:36 ` [PATCH V4 4/4] workqueue: Process extra works in rescuer when there are no more to rescue Lai Jiangshan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aS8s9ESMrbeTu_Zd@slm.duckdns.org \
--to=tj@kernel.org \
--cc=jiangshan.ljs@antgroup.com \
--cc=jiangshanlai@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=yc1082463@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome