From: Tejun Heo <tj@kernel.org>
To: Marco Crivellari <marco.crivellari@suse.com>
Cc: Breno Leitao <leitao@debian.org>,
linux-kernel@vger.kernel.org,
Lai Jiangshan <jiangshanlai@gmail.com>,
Frederic Weisbecker <frederic@kernel.org>,
Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
Michal Hocko <mhocko@suse.com>
Subject: Re: [RFC PATCH 0/2] Add queue_*() functions and prefer per-cpu workqueue and flag
Date: Thu, 7 May 2026 11:27:52 -1000 [thread overview]
Message-ID: <af0D2P0jUDFBmSuL@slm.duckdns.org> (raw)
In-Reply-To: <CAAofZF5p_AULqKfAip+vJeZLk42-YPZsYeSbW_otb7H_SUCntA@mail.gmail.com>
Hello,
On Thu, May 07, 2026 at 12:25:30PM +0200, Marco Crivellari wrote:
> So, either we're going to have an "unbound" version or we use
> queue_work() directly that sounds good to me. I guess retire - in
> future - schedule_work[_on]() would be cleaner: so that users must
> also specify the workqueue they really need to use.
Yeah, retiring would be my preference if we need to update them anyway. I
don't think the thin wrappers add anything useful.
> What do you both think about:
>
> - queue_percpu_work()
> - queue_dfl_work()
But if were to keep the wrappers, yeah, these are better names.
> Let me share where this was discussed a year ago:
>
> https://lore.kernel.org/all/Z79E_gbWm9j9bkfR@slm.duckdns.org/
>
> Perhaps - likely - I haven't understood the WQ_PREFER_PERCPU proposal
> here; I thought it was a workqueue flag, to be used like WQ_PERCPU or
> WQ_UNBOUND.
> Reading Tejun's reply is also clearer now.
Yeah, that was what was discussed then.
> Anyhow, this idea is based on customer reports I've seen previously.
> We noticed that with certain workloads, specific per-cpu work creates
> noise on isolated CPUs. With a flag like that we can identify which
> workqueues prefer to be per-cpu and *not* for correctness. This allows
> using a boot parameter / sysctl, for example, to keep those workqueues
> affined only to housekeeping CPUs.
>
> Of course, if we can achieve the same with a system workqueue (like
> system_prefer_percpu_wq), that would also be fine. I think it would be
> way easier, it should be similar to what we're doing with
> system_power_efficient_wq [1].
WQ_AFFN_CPU is more flexible as the tasks aren't pinned to the CPU but there
may be downsides:
- Concurrency management isn't available.
- Would create more kworkers.
Maybe the original plan can be adapted to:
- Add WQ_PERFER_PERCPU as discussed before.
- At boot time, allow selecting whether to back them with percpu wqs or
WQ_AFFN_X unbound ones. Maybe we can even experiment with default to
WQ_AFFN_CPU.
Thanks.
--
tejun
next prev parent reply other threads:[~2026-05-07 21:27 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-05 16:16 [RFC PATCH 0/2] Add queue_*() functions and prefer per-cpu workqueue and flag Marco Crivellari
2026-05-05 16:16 ` [RFC PATCH 1/2] workqueue: Add queue_*() functions, future schedule_*() replacement Marco Crivellari
2026-05-05 16:16 ` [RFC PATCH 2/2] workqueue: Add WQ_PREFER_PERCPU and system_prefer_percpu_wq Marco Crivellari
2026-05-05 20:18 ` [RFC PATCH 0/2] Add queue_*() functions and prefer per-cpu workqueue and flag Tejun Heo
2026-05-06 13:40 ` Breno Leitao
2026-05-07 10:25 ` Marco Crivellari
2026-05-07 21:27 ` Tejun Heo [this message]
2026-05-08 12:09 ` Frederic Weisbecker
2026-05-08 15:11 ` Tejun Heo
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=af0D2P0jUDFBmSuL@slm.duckdns.org \
--to=tj@kernel.org \
--cc=bigeasy@linutronix.de \
--cc=frederic@kernel.org \
--cc=jiangshanlai@gmail.com \
--cc=leitao@debian.org \
--cc=linux-kernel@vger.kernel.org \
--cc=marco.crivellari@suse.com \
--cc=mhocko@suse.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