workqueue: introduce a way to setworkqueue's scheduler
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 12 lines · On Mon, 2018-01-29 at 13:50 +0800, [email protected] wrote:
Quoted 2 lines
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:kernel/workqueue.c +1
-0@@ -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);
Quoted 6 lines
/*
* Thepool->attach_mutexensures %POOL_DISASSOCIATED remainspool->attach_mutexmay guarante it, add sched_setattr may apply the wq'ssched_attrto 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