[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z-1oj4zCByGN38J2@localhost.localdomain>
Date: Wed, 2 Apr 2025 18:40:47 +0200
From: Frederic Weisbecker <frederic@...nel.org>
To: Tejun Heo <tj@...nel.org>, Marco Crivellari <marco.crivellari@...e.com>
Cc: Sebastian Andrzej Siewior <bigeasy@...utronix.de>,
open list <linux-kernel@...r.kernel.org>,
Lai Jiangshan <jiangshanlai@...il.com>,
Thomas Gleixner <tglx@...utronix.de>
Subject: Re: [PATCH] workqueue: Always use wq_select_unbound_cpu() for
WORK_CPU_UNBOUND.
(Adding Marco who may help us in this long adventure)
Le Wed, Feb 26, 2025 at 06:44:46AM -1000, Tejun Heo a écrit :
> We can rename APIs too and it's going to be a slog, which, to be fair, this
> is going to be no matter what.
>
> > > 2. There still are cases where local execution isn't required for
> > > correctness but local & concurrency controlled executions yield
> > > performance gains. Workqueue API currently doesn't distinguish these two
> > > cases. We should add a new API which prefers local execution but doesn't
> > > require it, which can then do what's suggested in this patch.
> >
> > I see. So we get rid of the old naming and have them something like
> > schedule_bound_work()
> > schedule_unbound_work()
> > schedule_hopefully_local_work()
>
> If we're renaming, I'd deprecate the schedule_*() interface and always use
> queue_*() and maybe:
>
> - Replace WQ_UNBOUND with its complement WQ_PERCPU.
This one scares us a bit. Currently the default for alloc_workqueue() is
WQ_PERCPU. After that the default will be the reverse. Even if this
happens as a single patch treewide change, there will be conflicts
in the merge window with new users coming up that will happen to be
unbound whenever they were not intended to.
But there is a way out of that if we are patient:
1) For one release, do a treewide change that introduces WQ_PERCPU and apply
it to all relevant users. Keep WQ_UNBOUND around for now and warn if neither
WQ_PERCPU nor WQ_UNBOUND has been passed (this and grep/coccinelle will catch
missed patches from other trees after the merge window).
2) Once that complete, remove WQ_UNBOUND and its uses on the next release.
How does that sound?
> - Add WQ_PREFER_PERCPU.
This can be done afterward case by case.
> - Rename system_wq -> system_percpu_wq.
> - Add system_prefer_percpu_wq.
> - Rename system_unbound_wq -> system_dfl_wq.
Easy steps.
Thanks!
Powered by blists - more mailing lists