Messages in this thread | ![/](/images/icornerl.gif) | | Date | Wed, 13 Jan 2021 12:43:56 +0100 | From | Peter Zijlstra <> | Subject | Re: [PATCH 3/4] workqueue: Tag bound workers with KTHREAD_IS_PER_CPU |
| |
On Wed, Jan 13, 2021 at 12:36:55AM +0800, Lai Jiangshan wrote: > On Tue, Jan 12, 2021 at 10:51 PM Peter Zijlstra <peterz@infradead.org> wrote: > > > > Mark the per-cpu workqueue workers as KTHREAD_IS_PER_CPU. > > > > Workqueues have unfortunate semantics in that per-cpu workers are not > > default flushed and parked during hotplug, however a subset does > > manual flush on hotplug and hard relies on them for correctness. > > > > Therefore play silly games.. > > > > Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> > > Tested-by: Paul E. McKenney <paulmck@kernel.org> > > --- > > Reviewed-by: Lai Jiangshan <jiangshanlai@gmail.com> > > I like this patchset in that the scheduler takes care of the > affinities of the tasks when we don't want it to be per-cpu.
Thanks! A possibly even simpler approach would be to have rebind_workers() kill all workers and have create_worker() spawn us new ones.
That avoids ever having to use set_cpus_allowed_ptr() on per-cpu kthreads.... with the exception of rescuer.. still pondering that.
| ![\](/images/icornerr.gif) |