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: Wed, 3 Dec 2025 09:41:09 -1000 [thread overview]
Message-ID: <aTCSVU_cC3I_vuQq@slm.duckdns.org> (raw)
In-Reply-To: <CAJhGHyCretunE7VaG5ZSBtkwmC56K2YMgRt_9NbwNpf2Yt_yHA@mail.gmail.com>
Hello, Lai.
On Wed, Dec 03, 2025 at 11:22:32AM +0800, Lai Jiangshan wrote:
> On Wed, Dec 3, 2025 at 2:16 AM Tejun Heo <tj@kernel.org> wrote:
...
> > 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;
>
> The current implementation of the cursor cannot be processed by workers as a
> regular work item, which means it has no pwq reference and cannot be left
> behind if the pwq is not put back on the mayday list. As a result, the code
> here has to handle the cursor explicitly, which adds extra burden to
> understanding the code.
I'm probably missing something but what prevents rescuer_thread() from just
not calling assign_rescuer_work() and just call send_mayday() on the pwq?
send_mayday() currently takes @work but all it cares about is pwq, so we can
just pass in pwq.
Thanks.
--
tejun
next prev parent reply other threads:[~2025-12-03 19:41 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
2025-12-03 3:22 ` Lai Jiangshan
2025-12-03 19:41 ` Tejun Heo [this message]
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=aTCSVU_cC3I_vuQq@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