@@ -278,14 +278,12 @@ struct task_group {
278
278
#endif
279
279
};
280
280
281
- #define root_task_group init_task_group
282
-
283
281
/* task_group_lock serializes the addition/removal of task groups */
284
282
static DEFINE_SPINLOCK (task_group_lock );
285
283
286
284
#ifdef CONFIG_FAIR_GROUP_SCHED
287
285
288
- # define INIT_TASK_GROUP_LOAD NICE_0_LOAD
286
+ # define ROOT_TASK_GROUP_LOAD NICE_0_LOAD
289
287
290
288
/*
291
289
* A weight of 0 or 1 can cause arithmetics problems.
@@ -298,13 +296,13 @@ static DEFINE_SPINLOCK(task_group_lock);
298
296
#define MIN_SHARES 2
299
297
#define MAX_SHARES (1UL << 18)
300
298
301
- static int init_task_group_load = INIT_TASK_GROUP_LOAD ;
299
+ static int root_task_group_load = ROOT_TASK_GROUP_LOAD ;
302
300
#endif
303
301
304
302
/* Default task group.
305
303
* Every task in system belong to this group at bootup.
306
304
*/
307
- struct task_group init_task_group ;
305
+ struct task_group root_task_group ;
308
306
309
307
#endif /* CONFIG_CGROUP_SCHED */
310
308
@@ -743,7 +741,7 @@ sched_feat_write(struct file *filp, const char __user *ubuf,
743
741
buf [cnt ] = 0 ;
744
742
cmp = strstrip (buf );
745
743
746
- if (strncmp (buf , "NO_" , 3 ) == 0 ) {
744
+ if (strncmp (cmp , "NO_" , 3 ) == 0 ) {
747
745
neg = 1 ;
748
746
cmp += 3 ;
749
747
}
@@ -7848,7 +7846,7 @@ static void init_tg_cfs_entry(struct task_group *tg, struct cfs_rq *cfs_rq,
7848
7846
cfs_rq -> tg = tg ;
7849
7847
7850
7848
tg -> se [cpu ] = se ;
7851
- /* se could be NULL for init_task_group */
7849
+ /* se could be NULL for root_task_group */
7852
7850
if (!se )
7853
7851
return ;
7854
7852
@@ -7908,18 +7906,18 @@ void __init sched_init(void)
7908
7906
ptr = (unsigned long )kzalloc (alloc_size , GFP_NOWAIT );
7909
7907
7910
7908
#ifdef CONFIG_FAIR_GROUP_SCHED
7911
- init_task_group .se = (struct sched_entity * * )ptr ;
7909
+ root_task_group .se = (struct sched_entity * * )ptr ;
7912
7910
ptr += nr_cpu_ids * sizeof (void * * );
7913
7911
7914
- init_task_group .cfs_rq = (struct cfs_rq * * )ptr ;
7912
+ root_task_group .cfs_rq = (struct cfs_rq * * )ptr ;
7915
7913
ptr += nr_cpu_ids * sizeof (void * * );
7916
7914
7917
7915
#endif /* CONFIG_FAIR_GROUP_SCHED */
7918
7916
#ifdef CONFIG_RT_GROUP_SCHED
7919
- init_task_group .rt_se = (struct sched_rt_entity * * )ptr ;
7917
+ root_task_group .rt_se = (struct sched_rt_entity * * )ptr ;
7920
7918
ptr += nr_cpu_ids * sizeof (void * * );
7921
7919
7922
- init_task_group .rt_rq = (struct rt_rq * * )ptr ;
7920
+ root_task_group .rt_rq = (struct rt_rq * * )ptr ;
7923
7921
ptr += nr_cpu_ids * sizeof (void * * );
7924
7922
7925
7923
#endif /* CONFIG_RT_GROUP_SCHED */
@@ -7939,13 +7937,13 @@ void __init sched_init(void)
7939
7937
global_rt_period (), global_rt_runtime ());
7940
7938
7941
7939
#ifdef CONFIG_RT_GROUP_SCHED
7942
- init_rt_bandwidth (& init_task_group .rt_bandwidth ,
7940
+ init_rt_bandwidth (& root_task_group .rt_bandwidth ,
7943
7941
global_rt_period (), global_rt_runtime ());
7944
7942
#endif /* CONFIG_RT_GROUP_SCHED */
7945
7943
7946
7944
#ifdef CONFIG_CGROUP_SCHED
7947
- list_add (& init_task_group .list , & task_groups );
7948
- INIT_LIST_HEAD (& init_task_group .children );
7945
+ list_add (& root_task_group .list , & task_groups );
7946
+ INIT_LIST_HEAD (& root_task_group .children );
7949
7947
autogroup_init (& init_task );
7950
7948
#endif /* CONFIG_CGROUP_SCHED */
7951
7949
@@ -7960,34 +7958,34 @@ void __init sched_init(void)
7960
7958
init_cfs_rq (& rq -> cfs , rq );
7961
7959
init_rt_rq (& rq -> rt , rq );
7962
7960
#ifdef CONFIG_FAIR_GROUP_SCHED
7963
- init_task_group .shares = init_task_group_load ;
7961
+ root_task_group .shares = root_task_group_load ;
7964
7962
INIT_LIST_HEAD (& rq -> leaf_cfs_rq_list );
7965
7963
/*
7966
- * How much cpu bandwidth does init_task_group get?
7964
+ * How much cpu bandwidth does root_task_group get?
7967
7965
*
7968
7966
* In case of task-groups formed thr' the cgroup filesystem, it
7969
7967
* gets 100% of the cpu resources in the system. This overall
7970
7968
* system cpu resource is divided among the tasks of
7971
- * init_task_group and its child task-groups in a fair manner,
7969
+ * root_task_group and its child task-groups in a fair manner,
7972
7970
* based on each entity's (task or task-group's) weight
7973
7971
* (se->load.weight).
7974
7972
*
7975
- * In other words, if init_task_group has 10 tasks of weight
7973
+ * In other words, if root_task_group has 10 tasks of weight
7976
7974
* 1024) and two child groups A0 and A1 (of weight 1024 each),
7977
7975
* then A0's share of the cpu resource is:
7978
7976
*
7979
7977
* A0's bandwidth = 1024 / (10*1024 + 1024 + 1024) = 8.33%
7980
7978
*
7981
- * We achieve this by letting init_task_group 's tasks sit
7982
- * directly in rq->cfs (i.e init_task_group ->se[] = NULL).
7979
+ * We achieve this by letting root_task_group 's tasks sit
7980
+ * directly in rq->cfs (i.e root_task_group ->se[] = NULL).
7983
7981
*/
7984
- init_tg_cfs_entry (& init_task_group , & rq -> cfs , NULL , i , NULL );
7982
+ init_tg_cfs_entry (& root_task_group , & rq -> cfs , NULL , i , NULL );
7985
7983
#endif /* CONFIG_FAIR_GROUP_SCHED */
7986
7984
7987
7985
rq -> rt .rt_runtime = def_rt_bandwidth .rt_runtime ;
7988
7986
#ifdef CONFIG_RT_GROUP_SCHED
7989
7987
INIT_LIST_HEAD (& rq -> leaf_rt_rq_list );
7990
- init_tg_rt_entry (& init_task_group , & rq -> rt , NULL , i , NULL );
7988
+ init_tg_rt_entry (& root_task_group , & rq -> rt , NULL , i , NULL );
7991
7989
#endif
7992
7990
7993
7991
for (j = 0 ; j < CPU_LOAD_IDX_MAX ; j ++ )
@@ -8379,6 +8377,7 @@ static void free_sched_group(struct task_group *tg)
8379
8377
{
8380
8378
free_fair_sched_group (tg );
8381
8379
free_rt_sched_group (tg );
8380
+ autogroup_free (tg );
8382
8381
kfree (tg );
8383
8382
}
8384
8383
@@ -8812,7 +8811,7 @@ cpu_cgroup_create(struct cgroup_subsys *ss, struct cgroup *cgrp)
8812
8811
8813
8812
if (!cgrp -> parent ) {
8814
8813
/* This is early initialization for the top cgroup */
8815
- return & init_task_group .css ;
8814
+ return & root_task_group .css ;
8816
8815
}
8817
8816
8818
8817
parent = cgroup_tg (cgrp -> parent );
0 commit comments