Re: çå: Re: [RFC PATCH V5 5/5] workqueue: introduce a way to setworkqueue's scheduler

From: Mike Galbraith
Date: Mon Jan 29 2018 - 01:32:20 EST


On Mon, 2018-01-29 at 13:50 +0800, wen.yang99@xxxxxxxxxx wrote:
>
> > What happens when a new kworker needs to be spawned?
> create_worker -> worker_attach_to_pool, in the function
> worker_attach_to_poolï Âwe add this chunk:
>
> --- a/kernel/workqueue.c
> +++ b/kernel/workqueue.c
> @@ -1699,6 +1699,7 @@ static void worker_attach_to_pool(struct worker *worker,
> Â Â Â Â Â* online CPUs. ÂIt'll be re-applied when any of the CPUs come up.
> Â Â Â Â Â*/
> Â Â Â Â set_cpus_allowed_ptr(worker->task, pool->attrs->cpumask);
> + Â Â Â sched_setattr(worker->task, &pool->attrs->sched_attr);
> Â
> Â Â Â Â /*
> Â Â Â Â Â* The pool->attach_mutex ensures %POOL_DISASSOCIATED remains
> Â
> pool->attach_mutex may guarante it, add Âsched_setattr may apply the
> wq's sched_attr to the spawned kworer.

That doesn't help kthreadd get to a CPU in a box being saturated by RT.

As long as you are careful, it's not a problem, I just mentioned it
because it's a hole.

-Mike