aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sched/core.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/sched/core.c')
-rw-r--r--kernel/sched/core.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index e7c535eee0a6..c94895bc5a2c 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -6683,13 +6683,18 @@ static int tg_cfs_schedulable_down(struct task_group *tg, void *data)
6683 parent_quota = parent_b->hierarchical_quota; 6683 parent_quota = parent_b->hierarchical_quota;
6684 6684
6685 /* 6685 /*
6686 * Ensure max(child_quota) <= parent_quota, inherit when no 6686 * Ensure max(child_quota) <= parent_quota. On cgroup2,
6687 * always take the min. On cgroup1, only inherit when no
6687 * limit is set: 6688 * limit is set:
6688 */ 6689 */
6689 if (quota == RUNTIME_INF) 6690 if (cgroup_subsys_on_dfl(cpu_cgrp_subsys)) {
6690 quota = parent_quota; 6691 quota = min(quota, parent_quota);
6691 else if (parent_quota != RUNTIME_INF && quota > parent_quota) 6692 } else {
6692 return -EINVAL; 6693 if (quota == RUNTIME_INF)
6694 quota = parent_quota;
6695 else if (parent_quota != RUNTIME_INF && quota > parent_quota)
6696 return -EINVAL;
6697 }
6693 } 6698 }
6694 cfs_b->hierarchical_quota = quota; 6699 cfs_b->hierarchical_quota = quota;
6695 6700