Re: [PATCH v3 1/3] powerpc/numa: Set numa_node for all possible cpus

From: Srikar Dronamraju
Date: Fri May 08 2020 - 09:22:00 EST


* Christopher Lameter <cl@xxxxxxxxx> [2020-05-02 22:55:16]:

> On Fri, 1 May 2020, Srikar Dronamraju wrote:
>
> > - for_each_present_cpu(cpu)
> > - numa_setup_cpu(cpu);
> > + for_each_possible_cpu(cpu) {
> > + /*
> > + * Powerpc with CONFIG_NUMA always used to have a node 0,
> > + * even if it was memoryless or cpuless. For all cpus that
> > + * are possible but not present, cpu_to_node() would point
> > + * to node 0. To remove a cpuless, memoryless dummy node,
> > + * powerpc need to make sure all possible but not present
> > + * cpu_to_node are set to a proper node.
> > + */
> > + if (cpu_present(cpu))
> > + numa_setup_cpu(cpu);
> > + else
> > + set_cpu_numa_node(cpu, first_online_node);
> > + }
> > }
>
>
> Can this be folded into numa_setup_cpu?
>
> This looks more like numa_setup_cpu needs to change?
>

We can fold this into numa_setup_cpu().

However till now we were sure that numa_setup_cpu() would be called only for
a present cpu. That assumption will change.
+ (non-consequential) an additional check everytime cpu is hotplugged in.

If Michael Ellerman is okay with the change, I can fold it in.

--
Thanks and Regards
Srikar Dronamraju