Re: [PATCH v4] numa: make node_to_cpumask_map() NUMA_NO_NODE aware

From: Michal Hocko
Date: Mon Sep 16 2019 - 08:24:42 EST


On Mon 16-09-19 20:07:22, Yunsheng Lin wrote:
[...]
> >> @@ -861,9 +861,12 @@ void numa_remove_cpu(int cpu)
> >> */
> >> const struct cpumask *cpumask_of_node(int node)
> >> {
> >> - if (node >= nr_node_ids) {
> >> + if (node == NUMA_NO_NODE)
> >> + return cpu_online_mask;
> >> +
> >> + if ((unsigned int)node >= nr_node_ids) {
> >> printk(KERN_WARNING
> >> - "cpumask_of_node(%d): node > nr_node_ids(%u)\n",
> >> + "cpumask_of_node(%d): node >= nr_node_ids(%u)\n",
> >> node, nr_node_ids);
> >> dump_stack();
> >> return cpu_none_mask;
> >
> > Why do we need this?
>
> As the commit log says, the above cpumask_of_node() is for debugging,
> it should catch other "node < 0" cases except NUMA_NO_NODE.

OK, I would just make it a separate patch.

--
Michal Hocko
SUSE Labs