Re: [PATCH 3/4] workqueue: Tag bound workers with KTHREAD_IS_PER_CPU

From: Peter Zijlstra
Date: Sat Jan 16 2021 - 12:13:01 EST


On Sat, Jan 16, 2021 at 01:45:23PM +0100, Peter Zijlstra wrote:
> On Sat, Jan 16, 2021 at 02:27:09PM +0800, Lai Jiangshan wrote:

> > I feel nervous to use kthread_park() here and kthread_parkme() in
> > worker thread. And adding kthread_should_park() to the fast path
> > also daunt me.
>
> Is that really such a hot path that an additional load is problematic?

I think we can remove it. It would mean the kthread_park() from the
online callback will take a bit longer, as it will have to wait for all
the works to complete, but that should not be a fundamental problem.