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: Wed, 24 Jun 2026 09:46:55 -1000 [thread overview]
Message-ID: <ajw0L54oSnn5Z9as@slm.duckdns.org> (raw)
In-Reply-To: <CAAofZF4LDDPe0Xuidc46VCOK=7QjXYwz2r6j_uSr1sXpidQhOQ@mail.gmail.com>
Hello,
On Tue, Jun 23, 2026 at 05:13:31PM +0200, Marco Crivellari wrote:
> > - 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.
>
> You mentioned here "at boot time". What about making this also dynamic,
> "moving" the WQs with WQ_PREFER_PERCPU away from CPU N when N is
> isolated through a cgroup isolated partition?
Yeah, being dynamic is better but switching dynamically between percpu and
unbound workqueues feels like it's going to be complicated. I can't think of
a simple way to do that. If you can, please be my guest.
> I considered checking the flag inside __queue_work(), checking the
> isolated CPU mask to see if the CPU is unbound, and then choosing a
> different CPU accordingly.
>
> I'm also wondering: when an isolated CPU is added / removed, should we
> also act on the work items waiting in the worker pool?
> Should the worker pool be DISASSOCIATED when/if only work items queued
> with WQ_PREFER_PERCPU are on a CPU being isolated? I thought about
> this, and because the worker pool has a list of items queued by
> per-CPU WQs, I don't think it should be disassociated. Maybe I'm
> missing something btw.
I'm not sure overloading DISASSOCIATED with isolated handling is a good
idea. The CPU is still online and there are actual per-cpu work items to
execute there. Maybe you can split only preferred ones into their own pools
and mark them DISASSOCIATED but that sounds rather nasty to me.
Thanks.
--
tejun
next prev parent reply other threads:[~2026-06-24 19:46 UTC|newest]
Thread overview: 14+ 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
2026-05-08 12:09 ` Frederic Weisbecker
2026-05-08 15:11 ` Tejun Heo
2026-05-12 8:52 ` Marco Crivellari
2026-06-23 15:13 ` Marco Crivellari
2026-06-24 19:46 ` Tejun Heo [this message]
2026-07-08 13:58 ` Frederic Weisbecker
2026-07-08 16:29 ` 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=ajw0L54oSnn5Z9as@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