Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

nodemask: numa: reorganize inclusion path

Nodemasks now pull linux/numa.h for MAX_NUMNODES and NUMA_NO_NODE
macros. This series makes numa.h depending on nodemasks, so we hit
a circular dependency.

Nodemasks library is highly employed by NUMA code, and it would be
logical to resolve the circular dependency by making NUMA headers
dependent nodemask.h.

Signed-off-by: Yury Norov [NVIDIA] <yury.norov@gmail.com>
Signed-off-by: Andrea Righi <arighi@nvidia.com>
Signed-off-by: Tejun Heo <tj@kernel.org>

authored by

Yury Norov and committed by
Tejun Heo
14a8262f 7665054e

+11 -11
-1
include/linux/nodemask.h
··· 94 94 #include <linux/bitmap.h> 95 95 #include <linux/minmax.h> 96 96 #include <linux/nodemask_types.h> 97 - #include <linux/numa.h> 98 97 #include <linux/random.h> 99 98 100 99 extern nodemask_t _unused_nodemask_arg_;
+10 -1
include/linux/nodemask_types.h
··· 3 3 #define __LINUX_NODEMASK_TYPES_H 4 4 5 5 #include <linux/bitops.h> 6 - #include <linux/numa.h> 6 + 7 + #ifdef CONFIG_NODES_SHIFT 8 + #define NODES_SHIFT CONFIG_NODES_SHIFT 9 + #else 10 + #define NODES_SHIFT 0 11 + #endif 12 + 13 + #define MAX_NUMNODES (1 << NODES_SHIFT) 14 + 15 + #define NUMA_NO_NODE (-1) 7 16 8 17 typedef struct { DECLARE_BITMAP(bits, MAX_NUMNODES); } nodemask_t; 9 18
+1 -9
include/linux/numa.h
··· 3 3 #define _LINUX_NUMA_H 4 4 #include <linux/init.h> 5 5 #include <linux/types.h> 6 + #include <linux/nodemask.h> 6 7 7 - #ifdef CONFIG_NODES_SHIFT 8 - #define NODES_SHIFT CONFIG_NODES_SHIFT 9 - #else 10 - #define NODES_SHIFT 0 11 - #endif 12 - 13 - #define MAX_NUMNODES (1 << NODES_SHIFT) 14 - 15 - #define NUMA_NO_NODE (-1) 16 8 #define NUMA_NO_MEMBLK (-1) 17 9 18 10 static inline bool numa_valid_node(int nid)