aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/linux/init_task.h12
-rw-r--r--include/linux/sched.h5
2 files changed, 15 insertions, 2 deletions
diff --git a/include/linux/init_task.h b/include/linux/init_task.h
index 9e65eff6af3b..b806b821e735 100644
--- a/include/linux/init_task.h
+++ b/include/linux/init_task.h
@@ -123,8 +123,17 @@ extern struct group_info init_groups;
123 123
124extern struct cred init_cred; 124extern struct cred init_cred;
125 125
126extern struct task_group root_task_group;
127
128#ifdef CONFIG_CGROUP_SCHED
129# define INIT_CGROUP_SCHED(tsk) \
130 .sched_task_group = &root_task_group,
131#else
132# define INIT_CGROUP_SCHED(tsk)
133#endif
134
126#ifdef CONFIG_PERF_EVENTS 135#ifdef CONFIG_PERF_EVENTS
127# define INIT_PERF_EVENTS(tsk) \ 136# define INIT_PERF_EVENTS(tsk) \
128 .perf_event_mutex = \ 137 .perf_event_mutex = \
129 __MUTEX_INITIALIZER(tsk.perf_event_mutex), \ 138 __MUTEX_INITIALIZER(tsk.perf_event_mutex), \
130 .perf_event_list = LIST_HEAD_INIT(tsk.perf_event_list), 139 .perf_event_list = LIST_HEAD_INIT(tsk.perf_event_list),
@@ -161,6 +170,7 @@ extern struct cred init_cred;
161 }, \ 170 }, \
162 .tasks = LIST_HEAD_INIT(tsk.tasks), \ 171 .tasks = LIST_HEAD_INIT(tsk.tasks), \
163 INIT_PUSHABLE_TASKS(tsk) \ 172 INIT_PUSHABLE_TASKS(tsk) \
173 INIT_CGROUP_SCHED(tsk) \
164 .ptraced = LIST_HEAD_INIT(tsk.ptraced), \ 174 .ptraced = LIST_HEAD_INIT(tsk.ptraced), \
165 .ptrace_entry = LIST_HEAD_INIT(tsk.ptrace_entry), \ 175 .ptrace_entry = LIST_HEAD_INIT(tsk.ptrace_entry), \
166 .real_parent = &tsk, \ 176 .real_parent = &tsk, \
diff --git a/include/linux/sched.h b/include/linux/sched.h
index bc9952991710..fd9436a3a545 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -1245,6 +1245,9 @@ struct task_struct {
1245 const struct sched_class *sched_class; 1245 const struct sched_class *sched_class;
1246 struct sched_entity se; 1246 struct sched_entity se;
1247 struct sched_rt_entity rt; 1247 struct sched_rt_entity rt;
1248#ifdef CONFIG_CGROUP_SCHED
1249 struct task_group *sched_task_group;
1250#endif
1248 1251
1249#ifdef CONFIG_PREEMPT_NOTIFIERS 1252#ifdef CONFIG_PREEMPT_NOTIFIERS
1250 /* list of struct preempt_notifier: */ 1253 /* list of struct preempt_notifier: */
@@ -2724,7 +2727,7 @@ extern int sched_group_set_rt_period(struct task_group *tg,
2724extern long sched_group_rt_period(struct task_group *tg); 2727extern long sched_group_rt_period(struct task_group *tg);
2725extern int sched_rt_can_attach(struct task_group *tg, struct task_struct *tsk); 2728extern int sched_rt_can_attach(struct task_group *tg, struct task_struct *tsk);
2726#endif 2729#endif
2727#endif 2730#endif /* CONFIG_CGROUP_SCHED */
2728 2731
2729extern int task_can_switch_user(struct user_struct *up, 2732extern int task_can_switch_user(struct user_struct *up,
2730 struct task_struct *tsk); 2733 struct task_struct *tsk);