lkml.org 
[lkml]   [2020]   [Dec]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 04/10] workqueue: don't set the worker's cpumask when kthread_bind_mask()
On Mon, Dec 14, 2020 at 11:54:51PM +0800, Lai Jiangshan wrote:
> @@ -1945,7 +1945,15 @@ static struct worker *create_worker(struct worker_pool *pool)
> goto fail;
>
> set_user_nice(worker->task, pool->attrs->nice);
> - kthread_bind_mask(worker->task, pool->attrs->cpumask);
> +
> + /*
> + * Set PF_NO_SETAFFINITY via kthread_bind_mask(). We use
> + * cpu_possible_mask other than pool->attrs->cpumask, because
^
instead of

> + * there might be no online cpu in the pool->attrs->cpumask.
^
might not be any

> + * The cpumask of the worker will be set properly later in
> + * worker_attach_to_pool().
> + */
> + kthread_bind_mask(worker->task, cpu_possible_mask);

This is a bit ugly but not the end of the world. Maybe we can move it to the
start of worker_thread() but that'd require an extra handshake. Oh well...

Thanks.

--
tejun

\
 
 \ /
  Last update: 2020-12-16 15:41    [W:0.137 / U:1.476 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site