diff options
Diffstat (limited to 'kernel/sched.c')
-rw-r--r-- | kernel/sched.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/kernel/sched.c b/kernel/sched.c index 66ef5790d932..b646dad4a40e 100644 --- a/kernel/sched.c +++ b/kernel/sched.c | |||
@@ -79,6 +79,7 @@ | |||
79 | 79 | ||
80 | #include "sched_cpupri.h" | 80 | #include "sched_cpupri.h" |
81 | #include "workqueue_sched.h" | 81 | #include "workqueue_sched.h" |
82 | #include "sched_autogroup.h" | ||
82 | 83 | ||
83 | #define CREATE_TRACE_POINTS | 84 | #define CREATE_TRACE_POINTS |
84 | #include <trace/events/sched.h> | 85 | #include <trace/events/sched.h> |
@@ -271,6 +272,10 @@ struct task_group { | |||
271 | struct task_group *parent; | 272 | struct task_group *parent; |
272 | struct list_head siblings; | 273 | struct list_head siblings; |
273 | struct list_head children; | 274 | struct list_head children; |
275 | |||
276 | #ifdef CONFIG_SCHED_AUTOGROUP | ||
277 | struct autogroup *autogroup; | ||
278 | #endif | ||
274 | }; | 279 | }; |
275 | 280 | ||
276 | #define root_task_group init_task_group | 281 | #define root_task_group init_task_group |
@@ -603,11 +608,14 @@ static inline int cpu_of(struct rq *rq) | |||
603 | */ | 608 | */ |
604 | static inline struct task_group *task_group(struct task_struct *p) | 609 | static inline struct task_group *task_group(struct task_struct *p) |
605 | { | 610 | { |
611 | struct task_group *tg; | ||
606 | struct cgroup_subsys_state *css; | 612 | struct cgroup_subsys_state *css; |
607 | 613 | ||
608 | css = task_subsys_state_check(p, cpu_cgroup_subsys_id, | 614 | css = task_subsys_state_check(p, cpu_cgroup_subsys_id, |
609 | lockdep_is_held(&task_rq(p)->lock)); | 615 | lockdep_is_held(&task_rq(p)->lock)); |
610 | return container_of(css, struct task_group, css); | 616 | tg = container_of(css, struct task_group, css); |
617 | |||
618 | return autogroup_task_group(p, tg); | ||
611 | } | 619 | } |
612 | 620 | ||
613 | /* Change a task's cfs_rq and parent entity if it moves across CPUs/groups */ | 621 | /* Change a task's cfs_rq and parent entity if it moves across CPUs/groups */ |
@@ -1869,6 +1877,7 @@ static void sched_irq_time_avg_update(struct rq *rq, u64 curr_irq_time) { } | |||
1869 | #include "sched_idletask.c" | 1877 | #include "sched_idletask.c" |
1870 | #include "sched_fair.c" | 1878 | #include "sched_fair.c" |
1871 | #include "sched_rt.c" | 1879 | #include "sched_rt.c" |
1880 | #include "sched_autogroup.c" | ||
1872 | #include "sched_stoptask.c" | 1881 | #include "sched_stoptask.c" |
1873 | #ifdef CONFIG_SCHED_DEBUG | 1882 | #ifdef CONFIG_SCHED_DEBUG |
1874 | # include "sched_debug.c" | 1883 | # include "sched_debug.c" |
@@ -7750,7 +7759,7 @@ void __init sched_init(void) | |||
7750 | #ifdef CONFIG_CGROUP_SCHED | 7759 | #ifdef CONFIG_CGROUP_SCHED |
7751 | list_add(&init_task_group.list, &task_groups); | 7760 | list_add(&init_task_group.list, &task_groups); |
7752 | INIT_LIST_HEAD(&init_task_group.children); | 7761 | INIT_LIST_HEAD(&init_task_group.children); |
7753 | 7762 | autogroup_init(&init_task); | |
7754 | #endif /* CONFIG_CGROUP_SCHED */ | 7763 | #endif /* CONFIG_CGROUP_SCHED */ |
7755 | 7764 | ||
7756 | for_each_possible_cpu(i) { | 7765 | for_each_possible_cpu(i) { |