lkml.org 
[lkml]   [2015]   [Jun]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC] kthread_create_on_node is failing to honor the node choice
On 06/26/2015 05:44 AM, Nathan Zimmer wrote:
> In kthread_create_on_node we set_cpus_allowed to cpu_all_mask
> regardless of what the node is requested.
> This seems incorrect.
>
> Signed-off-by: Nathan Zimmer <nzimmer@sgi.com>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: Nishanth Aravamudan <nacc@linux.vnet.ibm.com>
> Cc: Tejun Heo <tj@kernel.org>
> Cc: Lai Jiangshan <laijs@cn.fujitsu.com>
> Cc: Mel Gorman <mgorman@suse.de>
> Cc: linux-kernel@vger.kernel.org
>
> ---
> kernel/kthread.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/kernel/kthread.c b/kernel/kthread.c
> index 10e489c..d885d66 100644
> --- a/kernel/kthread.c
> +++ b/kernel/kthread.c
> @@ -318,7 +318,10 @@ struct task_struct *kthread_create_on_node(int (*threadfn)(void *data),
> * The kernel thread should not inherit these properties.
> */
> sched_setscheduler_nocheck(task, SCHED_NORMAL, &param);
> - set_cpus_allowed_ptr(task, cpu_all_mask);
> + if (node == -1)
> + set_cpus_allowed_ptr(task, cpu_all_mask);
> + else
> + set_cpus_allowed_ptr(task, cpumask_of_node(node));


cpumask_of_node(node) is bad here. It containers only online cpus.

> }
> kfree(create);
> return task;
>



\
 
 \ /
  Last update: 2015-06-26 03:21    [W:0.096 / U:0.064 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site