Re: [PATCH 04/19] sched/numa: Set preferred_node based on best_cpu

From: Peter Zijlstra
Date: Mon Jun 04 2018 - 08:23:48 EST


On Mon, Jun 04, 2018 at 03:30:13PM +0530, Srikar Dronamraju wrote:
> @@ -1785,15 +1786,13 @@ static int task_numa_migrate(struct task_struct *p)
> * trying for a better one later. Do not set the preferred node here.
> */
> if (p->numa_group) {
> - struct numa_group *ng = p->numa_group;
> -
> if (env.best_cpu == -1)
> nid = env.src_nid;
> else
> - nid = env.dst_nid;
> + nid = cpu_to_node(env.best_cpu);

OK, the above matches the description, but I'm puzzled by the remainder:

>
> - if (ng->active_nodes > 1 && numa_is_active_node(env.dst_nid, ng))
> - sched_setnuma(p, env.dst_nid);
> + if (nid != p->numa_preferred_nid)
> + sched_setnuma(p, nid);
> }

That seems to entirely loose the active_node thing, or are you saying
best_cpu already includes that? (Changelog could use a little help there
I suppose)