summaryrefslogtreecommitdiffstats
path: root/kernel/sched
diff options
context:
space:
mode:
authorIngo Molnar2018-03-20 08:08:02 +0100
committerIngo Molnar2018-03-20 08:08:02 +0100
commit10c18c44a6494167e7a7ca3a3a61a67972017bdf (patch)
tree20c3afe744b0d88783161169ec88e45a53662fe7 /kernel/sched
parentsched/core: Remove TASK_ALL (diff)
parentMerge branch 'for-4.16-fixes' of git://git.kernel.org/pub/scm/linux/kernel/gi... (diff)
downloadkernel-qcow2-linux-10c18c44a6494167e7a7ca3a3a61a67972017bdf.tar.gz
kernel-qcow2-linux-10c18c44a6494167e7a7ca3a3a61a67972017bdf.tar.xz
kernel-qcow2-linux-10c18c44a6494167e7a7ca3a3a61a67972017bdf.zip
Merge branch 'linus' into sched/core, to pick up fixes
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'kernel/sched')
-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 c7faeb7bd03a..b249adbf2a48 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -6733,13 +6733,18 @@ static int tg_cfs_schedulable_down(struct task_group *tg, void *data)
parent_quota = parent_b->hierarchical_quota;
/*
- * Ensure max(child_quota) <= parent_quota, inherit when no
+ * Ensure max(child_quota) <= parent_quota. On cgroup2,
+ * always take the min. On cgroup1, only inherit when no
* limit is set:
*/
- if (quota == RUNTIME_INF)
- quota = parent_quota;
- else if (parent_quota != RUNTIME_INF && quota > parent_quota)
- return -EINVAL;
+ if (cgroup_subsys_on_dfl(cpu_cgrp_subsys)) {
+ quota = min(quota, parent_quota);
+ } else {
+ if (quota == RUNTIME_INF)
+ quota = parent_quota;
+ else if (parent_quota != RUNTIME_INF && quota > parent_quota)
+ return -EINVAL;
+ }
}
cfs_b->hierarchical_quota = quota;