aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sched.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2009-03-12 21:14:25 -0400
committerIngo Molnar <mingo@elte.hu>2009-03-12 21:14:25 -0400
commit25d500067d5a666d1336598d1b324793554e5496 (patch)
tree3402308c4c69a66d02ce55f5c165e242fad2a8a9 /kernel/sched.c
parent0b13fda1e0936b3d64c4c407f183d33fa6bd2ad4 (diff)
parent9ead64974b05501bbac0d63a47c99fa786d064ba (diff)
Merge branch 'linus' into core/ipi
Diffstat (limited to 'kernel/sched.c')
-rw-r--r--kernel/sched.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/kernel/sched.c b/kernel/sched.c
index d4c2749a299..f1cd7191824 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -223,7 +223,7 @@ static void start_rt_bandwidth(struct rt_bandwidth *rt_b)
223{ 223{
224 ktime_t now; 224 ktime_t now;
225 225
226 if (rt_bandwidth_enabled() && rt_b->rt_runtime == RUNTIME_INF) 226 if (!rt_bandwidth_enabled() || rt_b->rt_runtime == RUNTIME_INF)
227 return; 227 return;
228 228
229 if (hrtimer_active(&rt_b->rt_period_timer)) 229 if (hrtimer_active(&rt_b->rt_period_timer))
@@ -9224,6 +9224,16 @@ static int sched_rt_global_constraints(void)
9224 9224
9225 return ret; 9225 return ret;
9226} 9226}
9227
9228int sched_rt_can_attach(struct task_group *tg, struct task_struct *tsk)
9229{
9230 /* Don't accept realtime tasks when there is no way for them to run */
9231 if (rt_task(tsk) && tg->rt_bandwidth.rt_runtime == 0)
9232 return 0;
9233
9234 return 1;
9235}
9236
9227#else /* !CONFIG_RT_GROUP_SCHED */ 9237#else /* !CONFIG_RT_GROUP_SCHED */
9228static int sched_rt_global_constraints(void) 9238static int sched_rt_global_constraints(void)
9229{ 9239{
@@ -9317,8 +9327,7 @@ cpu_cgroup_can_attach(struct cgroup_subsys *ss, struct cgroup *cgrp,
9317 struct task_struct *tsk) 9327 struct task_struct *tsk)
9318{ 9328{
9319#ifdef CONFIG_RT_GROUP_SCHED 9329#ifdef CONFIG_RT_GROUP_SCHED
9320 /* Don't accept realtime tasks when there is no way for them to run */ 9330 if (!sched_rt_can_attach(cgroup_tg(cgrp), tsk))
9321 if (rt_task(tsk) && cgroup_tg(cgrp)->rt_bandwidth.rt_runtime == 0)
9322 return -EINVAL; 9331 return -EINVAL;
9323#else 9332#else
9324 /* We don't support RT-tasks being in separate groups */ 9333 /* We don't support RT-tasks being in separate groups */