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

nodemask: Split out include/linux/nodemask_types.h

sched.h, which defines task_struct, needs nodemask_t - but sched.h is a
frequently used header and ideally shouldn't be pulling in any more code
that it needs to.

This splits out nodemask_types.h which has the definition sched.h needs,
which will avoid a circular header dependency in the alloc tagging patch
series, and as a bonus should speed up kernel build times.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>

+12 -2
+1 -1
include/linux/nodemask.h
··· 93 93 #include <linux/threads.h> 94 94 #include <linux/bitmap.h> 95 95 #include <linux/minmax.h> 96 + #include <linux/nodemask_types.h> 96 97 #include <linux/numa.h> 97 98 #include <linux/random.h> 98 99 99 - typedef struct { DECLARE_BITMAP(bits, MAX_NUMNODES); } nodemask_t; 100 100 extern nodemask_t _unused_nodemask_arg_; 101 101 102 102 /**
+10
include/linux/nodemask_types.h
··· 1 + /* SPDX-License-Identifier: GPL-2.0 */ 2 + #ifndef __LINUX_NODEMASK_TYPES_H 3 + #define __LINUX_NODEMASK_TYPES_H 4 + 5 + #include <linux/bitops.h> 6 + #include <linux/numa.h> 7 + 8 + typedef struct { DECLARE_BITMAP(bits, MAX_NUMNODES); } nodemask_t; 9 + 10 + #endif /* __LINUX_NODEMASK_TYPES_H */
+1 -1
include/linux/sched.h
··· 20 20 #include <linux/hrtimer.h> 21 21 #include <linux/irqflags.h> 22 22 #include <linux/seccomp.h> 23 - #include <linux/nodemask.h> 23 + #include <linux/nodemask_types.h> 24 24 #include <linux/rcupdate.h> 25 25 #include <linux/refcount.h> 26 26 #include <linux/resource.h>