Thread (5 messages) 5 messages, 2 authors, 2019-09-16

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

From: Michal Hocko <mhocko@kernel.org>
Date: 2019-09-16 12:24:42
Also in: linux-alpha, linux-mips, linux-s390, linux-sh, lkml, sparclinux

On Mon 16-09-19 20:07:22, Yunsheng Lin wrote:
[...]
quoted
quoted
@@ -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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help