Re: [RFC PATCH 0/2] Add queue_*() functions and prefer per-cpu workqueue and flag

From: Frederic Weisbecker

Date: Fri May 08 2026 - 08:09:50 EST


Le Thu, May 07, 2026 at 11:27:52AM -1000, Tejun Heo a écrit :
> > 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.

Isn't WQ_POWER_EFFICIENT enough for what we want here? ie: it does a per-cpu
preference except when some config is enabled or isolation is on. It could be
renamed to WQ_PREFER_PERCPU to generalize its meaning for more than just power
purposes.

Thanks.

--
Frederic Weisbecker
SUSE Labs