]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
nodemask: numa: reorganize inclusion path
authorYury Norov <yury.norov@gmail.com>
Fri, 14 Feb 2025 19:40:01 +0000 (20:40 +0100)
committerTejun Heo <tj@kernel.org>
Sun, 16 Feb 2025 16:52:19 +0000 (06:52 -1000)
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>
include/linux/nodemask.h
include/linux/nodemask_types.h
include/linux/numa.h

index 41cf43c4e70f28c6a8d7db6f1f9361d3e8b4b43b..f0ac0633366b9070739f432177c5887d4983414e 100644 (file)
@@ -94,7 +94,6 @@
 #include <linux/bitmap.h>
 #include <linux/minmax.h>
 #include <linux/nodemask_types.h>
-#include <linux/numa.h>
 #include <linux/random.h>
 
 extern nodemask_t _unused_nodemask_arg_;
index 6b28d97ea6ed0274c00f360facd9add53cead9c7..f850a48742f1f652789ebc33dfd0d2c085721e85 100644 (file)
@@ -3,7 +3,16 @@
 #define __LINUX_NODEMASK_TYPES_H
 
 #include <linux/bitops.h>
-#include <linux/numa.h>
+
+#ifdef CONFIG_NODES_SHIFT
+#define NODES_SHIFT     CONFIG_NODES_SHIFT
+#else
+#define NODES_SHIFT     0
+#endif
+
+#define MAX_NUMNODES    (1 << NODES_SHIFT)
+
+#define        NUMA_NO_NODE    (-1)
 
 typedef struct { DECLARE_BITMAP(bits, MAX_NUMNODES); } nodemask_t;
 
index 3567e40329ebce380ba8132181a77fe7244be7b2..31d8bf8a951a749636d456b1a1977c6c9139f43e 100644 (file)
@@ -3,16 +3,8 @@
 #define _LINUX_NUMA_H
 #include <linux/init.h>
 #include <linux/types.h>
+#include <linux/nodemask.h>
 
-#ifdef CONFIG_NODES_SHIFT
-#define NODES_SHIFT     CONFIG_NODES_SHIFT
-#else
-#define NODES_SHIFT     0
-#endif
-
-#define MAX_NUMNODES    (1 << NODES_SHIFT)
-
-#define        NUMA_NO_NODE    (-1)
 #define        NUMA_NO_MEMBLK  (-1)
 
 static inline bool numa_valid_node(int nid)