Re: [GIT PULL] workqueue fixes for v4.13-rc3

From: Tejun Heo
Date: Thu Aug 24 2017 - 10:33:49 EST


Hello,

On Thu, Aug 24, 2017 at 03:32:04PM +0200, Geert Uytterhoeven wrote:
> > Ah, okay, so it has multiple nodes but not NUMA. The generic numa
> > topology code assumes that there's only one node if !NUMA and reports
> > all online cpus regardless of the node number, which makes the same
> > CPUs to be reported for all nodes on the system. I think something
> > like the following (completely untested) should work.
>
> Thank you, that got rid of the warning.

Great, it turns out we already have cpu_none_mask. Can you please
test the following works too?

Thanks.

diff --git a/include/asm-generic/topology.h b/include/asm-generic/topology.h
index fc824e2..5d2add1 100644
--- a/include/asm-generic/topology.h
+++ b/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)