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 <[email protected]>
Cc: Andrew Morton <[email protected]>
Cc: Nishanth Aravamudan <[email protected]>
Cc: Tejun Heo <[email protected]>
Cc: Lai Jiangshan <[email protected]>
Cc: Mel Gorman <[email protected]>
Cc: [email protected]

---
 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));
        }
        kfree(create);
        return task;
-- 
1.8.2.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to