From: Tejun Heo <tj@kernel.org>
To: Marco Crivellari <marco.crivellari@suse.com>
Cc: 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>, Breno Leitao <leitao@debian.org>
Subject: Re: [PATCH RFC 2/3] workqueue: Offload WQ_PREFER_PERCPU work from isolated CPUs
Date: Fri, 27 Nov 2026 10:54:03 -1000 [thread overview]
Message-ID: <61d55bd46d48bcf8ca03aa7ce517d000@kernel.org> (raw)
In-Reply-To: <20261126152458.742942-3-marco.crivellari@suse.com>
Hello, Marco.
On Thu, Nov 26, 2026 at 04:24:57PM +0100, Marco Crivellari wrote:
> Many WQ_PERCPU users don't need per-cpu execution for correctness, they
> only want cache locality. For them, running on an isolated CPU is just
> noise for the isolated workload.
>
> WQ_PREFER_PERCPU covers this case. It implies WQ_PERCPU, so by default
> the workqueue is a regular concurrency-managed per-cpu workqueue. When a
> CPU is isolated, its pwq is backed by an unbound pool running on the
> housekeeping CPUs instead.
If the need is just affinity, wouldn't an unbound workqueue with
WQ_AFFN_CPU do? The only material difference between WQ_AFFN_CPU and a
percpu workqueue is concurrency management, and the pwqs that get switched
to unbound pools here lose it. If concurrency management isn't needed, is
there any point in this mechanism?
> - if (is_percpu_pool(pool)) {
> + if (wq->flags & WQ_PERCPU) {
> obtained = pwq->nr_active < READ_ONCE(wq->percpu_max_active);
> goto out;
> }
Why does this switch from is_percpu_pool() to testing WQ_PERCPU?
Concurrency management is tied to the pool, isn't it?
> +static void prefer_percpu_wq_update_pwq(struct workqueue_struct *wq, int cpu)
...
> +static void wq_update_prefer_percpu_pwqs(const struct cpumask *cpus)
These two names are too confusing.
Thanks.
--
tejun
next prev parent reply other threads:[~2026-11-27 20:54 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-26 15:24 [PATCH RFC 0/3] workqueue: Add WQ_PREFER_PERCPU Marco Crivellari
2026-11-26 15:24 ` [PATCH RFC 1/3] workqueue: Add WQ_PREFER_PERCPU and system_prefer_percpu_wq Marco Crivellari
2026-11-26 15:24 ` [PATCH RFC 2/3] workqueue: Offload WQ_PREFER_PERCPU work from isolated CPUs Marco Crivellari
2026-11-27 20:54 ` Tejun Heo [this message]
2026-11-26 15:24 ` [PATCH RFC 3/3] workqueue: doc: Document WQ_PREFER_PERCPU Marco Crivellari
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=61d55bd46d48bcf8ca03aa7ce517d000@kernel.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