[merged] cpumask-fix-spurious-cpumask_of_node-on-non-numa-multi-node-configs.patch removed from -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     Subject: cpumask: fix spurious cpumask_of_node() on non-NUMA multi-node configs
has been removed from the -mm tree.  Its filename was
     cpumask-fix-spurious-cpumask_of_node-on-non-numa-multi-node-configs.patch

This patch was dropped because it was merged into mainline or a subsystem tree

------------------------------------------------------
From: Tejun Heo <tj@xxxxxxxxxx>
Subject: cpumask: fix spurious cpumask_of_node() on non-NUMA multi-node configs

When !CONFIG_NUMA, cpumask_of_node(@node) equals cpu_online_mask
regardless of @node.  The assumption seems that if !NUMA, there shouldn't
be more than one node and thus reporting cpu_online_mask regardless of
@node is correct.  However, that assumption was broken years ago to
support CONFIG_DISCONTIGMEM and whether a system has multiple nodes or not
is separately controlled by CONFIG_NEED_MULTIPLE_NODES.

This means that, on a system with !CONFIG_NUMA &&
CONFIG_NEED_MULTIPLE_NODES, cpumask_of_node() will report cpu_online_mask
for all possible nodes, indicating that the CPUs are associated with
multiple nodes which is an impossible configuration.

This bug has been around forever but doesn't look like it has caused any
noticeable symptoms.  However, it triggers a WARN recently added to
workqueue to verify NUMA affinity configuration.

Fix it by reporting empty cpumask on non-zero nodes if !NUMA.

Link: http://lkml.kernel.org/r/20170828215127.GC491396@xxxxxxxxxxxxxxxxxxxxxxxxxxx
Signed-off-by: Tejun Heo <tj@xxxxxxxxxx>
Reported-by: Geert Uytterhoeven <geert@xxxxxxxxxxxxxx>
Tested-by: Geert Uytterhoeven <geert@xxxxxxxxxxxxxx>
Cc: <stable@xxxxxxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 include/asm-generic/topology.h |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff -puN include/asm-generic/topology.h~cpumask-fix-spurious-cpumask_of_node-on-non-numa-multi-node-configs include/asm-generic/topology.h
--- a/include/asm-generic/topology.h~cpumask-fix-spurious-cpumask_of_node-on-non-numa-multi-node-configs
+++ a/include/asm-generic/topology.h
@@ -48,7 +48,11 @@
 #define parent_node(node)	((void)(node),0)
 #endif
 #ifndef cpumask_of_node
-#define cpumask_of_node(node)	((void)node, cpu_online_mask)
+  #ifdef CONFIG_NEED_MULTIPLE_NODES
+    #define cpumask_of_node(node)	((node) == 0 ? cpu_online_mask : cpu_none_mask)
+  #else
+    #define cpumask_of_node(node)	((void)node, cpu_online_mask)
+  #endif
 #endif
 #ifndef pcibus_to_node
 #define pcibus_to_node(bus)	((void)(bus), -1)
_

Patches currently in -mm which might be from tj@xxxxxxxxxx are





[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]