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

2019-09-16 Thread Yunsheng Lin
On 2019/9/16 20:23, Michal Hocko wrote: > 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)

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

2019-09-16 Thread Michal Hocko
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; > >> + >

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

2019-09-16 Thread Yunsheng Lin
On 2019/9/16 16:43, Michal Hocko wrote: > On Sun 15-09-19 16:20:56, Yunsheng Lin wrote: >> When passing the return value of dev_to_node() to cpumask_of_node() >> without checking if the device's node id is NUMA_NO_NODE, there is >> global-out-of-bounds detected by KASAN. >> >> >From the discussion

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

2019-09-16 Thread Michal Hocko
On Sun 15-09-19 16:20:56, Yunsheng Lin wrote: > When passing the return value of dev_to_node() to cpumask_of_node() > without checking if the device's node id is NUMA_NO_NODE, there is > global-out-of-bounds detected by KASAN. > > >From the discussion [1], NUMA_NO_NODE really means no node

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

2019-09-15 Thread Yunsheng Lin
When passing the return value of dev_to_node() to cpumask_of_node() without checking if the device's node id is NUMA_NO_NODE, there is global-out-of-bounds detected by KASAN. >From the discussion [1], NUMA_NO_NODE really means no node affinity, which also means all cpus should be usable. So the