[PATCH 58/89] sched/headers: Move the 'root_task_group' declaration to <linux/sched/autogroup.h>

From: Ingo Molnar
Date: Mon Feb 06 2017 - 08:44:07 EST


Also remove the duplicate declaration from <linux/init_task.h>.

( That declaration was originally duplicated for dependency hell reasons,
but there's no problem including the much smaller <linux/sched/autogroup.h>
header now, to pick up the right prototype. )

Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
Cc: Mike Galbraith <efault@xxxxxx>
Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
Cc: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>
Cc: linux-kernel@xxxxxxxxxxxxxxx
Signed-off-by: Ingo Molnar <mingo@xxxxxxxxxx>
---
include/linux/init_task.h | 3 +--
include/linux/sched.h | 4 ----
include/linux/sched/autogroup.h | 5 +++++
kernel/sched/sched.h | 1 +
4 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/include/linux/init_task.h b/include/linux/init_task.h
index 3a85d61f7614..fda57da8731b 100644
--- a/include/linux/init_task.h
+++ b/include/linux/init_task.h
@@ -12,6 +12,7 @@
#include <linux/securebits.h>
#include <linux/seqlock.h>
#include <linux/rbtree.h>
+#include <linux/sched/autogroup.h>
#include <net/net_namespace.h>
#include <linux/sched/rt.h>

@@ -149,8 +150,6 @@ extern struct group_info init_groups;

extern struct cred init_cred;

-extern struct task_group root_task_group;
-
#ifdef CONFIG_CGROUP_SCHED
# define INIT_CGROUP_SCHED(tsk) \
.sched_task_group = &root_task_group,
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 10fe373612fb..eed8d9148b23 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -1706,10 +1706,6 @@ static inline void set_task_cpu(struct task_struct *p, unsigned int cpu)
extern long sched_setaffinity(pid_t pid, const struct cpumask *new_mask);
extern long sched_getaffinity(pid_t pid, struct cpumask *mask);

-#ifdef CONFIG_CGROUP_SCHED
-extern struct task_group root_task_group;
-#endif /* CONFIG_CGROUP_SCHED */
-
#ifndef TASK_SIZE_OF
#define TASK_SIZE_OF(tsk) TASK_SIZE
#endif
diff --git a/include/linux/sched/autogroup.h b/include/linux/sched/autogroup.h
index c0810fe196f4..55cd496df884 100644
--- a/include/linux/sched/autogroup.h
+++ b/include/linux/sched/autogroup.h
@@ -3,6 +3,7 @@

struct signal_struct;
struct task_struct;
+struct task_group;
struct seq_file;

#ifdef CONFIG_SCHED_AUTOGROUP
@@ -23,4 +24,8 @@ static inline void sched_autogroup_exit(struct signal_struct *sig) { }
static inline void sched_autogroup_exit_task(struct task_struct *p) { }
#endif

+#ifdef CONFIG_CGROUP_SCHED
+extern struct task_group root_task_group;
+#endif /* CONFIG_CGROUP_SCHED */
+
#endif /* _LINUX_SCHED_AUTOGROUP_H */
diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h
index 4e2fec3f12a0..b1f1c8443837 100644
--- a/kernel/sched/sched.h
+++ b/kernel/sched/sched.h
@@ -1,5 +1,6 @@

#include <linux/sched.h>
+#include <linux/sched/autogroup.h>
#include <linux/sched/sysctl.h>
#include <linux/sched/topology.h>
#include <linux/sched/rt.h>
--
2.7.4