OSDN Git Service

sched, cgroup: Restore meaning to hierarchical_quota
[tomoyo/tomoyo-test1.git] / kernel / sched / core.c
index 83e3654..3af25ca 100644 (file)
@@ -9953,7 +9953,7 @@ void __init sched_init(void)
                ptr += nr_cpu_ids * sizeof(void **);
 
                root_task_group.shares = ROOT_TASK_GROUP_LOAD;
-               init_cfs_bandwidth(&root_task_group.cfs_bandwidth);
+               init_cfs_bandwidth(&root_task_group.cfs_bandwidth, NULL);
 #endif /* CONFIG_FAIR_GROUP_SCHED */
 #ifdef CONFIG_RT_GROUP_SCHED
                root_task_group.rt_se = (struct sched_rt_entity **)ptr;
@@ -11087,11 +11087,16 @@ static int tg_cfs_schedulable_down(struct task_group *tg, void *data)
 
                /*
                 * Ensure max(child_quota) <= parent_quota.  On cgroup2,
-                * always take the min.  On cgroup1, only inherit when no
-                * limit is set:
+                * always take the non-RUNTIME_INF min.  On cgroup1, only
+                * inherit when no limit is set. In both cases this is used
+                * by the scheduler to determine if a given CFS task has a
+                * bandwidth constraint at some higher level.
                 */
                if (cgroup_subsys_on_dfl(cpu_cgrp_subsys)) {
-                       quota = min(quota, parent_quota);
+                       if (quota == RUNTIME_INF)
+                               quota = parent_quota;
+                       else if (parent_quota != RUNTIME_INF)
+                               quota = min(quota, parent_quota);
                } else {
                        if (quota == RUNTIME_INF)
                                quota = parent_quota;