On Thu, Jul 09, 2015 at 03:12:59PM -0700, Andrew Morton wrote:
> On Thu, 25 Jun 2015 16:44:13 -0500 Nathan Zimmer <[email protected]> wrote:
> 
> > In kthread_create_on_node we set_cpus_allowed to cpu_all_mask
> > regardless of what the node is requested.
> > This seems incorrect.
> 
> The `node' arg to kthread_create_on_node() refers to which node the
> task_struct and thread_info are allocated from.  It doesn't refer to
> the CPUs upon which the thread is executed.  See
> kthread_create_info.node and that gruesome task_struct.pref_node_fork
> thing.
> 

That's the initial mistake I made when reviewing Nathan's first path.

> The kthread_create_on_node() kerneldoc explains this, in a confused
> way.  It needs a s/-1/NUMA_NO_NODE/.
> 
> I'm a bit surprised that kthread_create_on_node() futzes with the new
> thread's policy and cpumask after it has been created.  Wouldn't it be
> simpler/faster to have the thread itself set these things while it's
> starting up?
> 

Yeah, which is what Nathan's first patch did that I made a mistake with
initially. It creates a thread, sets the mask then wakes it up which
looks correct.

Your documentation patch looks good to me, I would not have fallen into
the trap if it had been applied.

-- 
Mel Gorman
SUSE Labs
--
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