diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-03-04 05:42:31 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-03-04 05:42:31 -0500 |
commit | 8163d88c79dca35478a2405c837733ac50ea4c39 (patch) | |
tree | 6acae066a09b7dcbedab4a35ad62eba4ba3fd83c /kernel/sched.c | |
parent | a1ef58f442542d8b3e3b963339fbc522c36e827c (diff) | |
parent | fec6c6fec3e20637bee5d276fb61dd8b49a3f9cc (diff) |
Merge commit 'v2.6.29-rc7' into perfcounters/core
Conflicts:
arch/x86/mm/iomap_32.c
Diffstat (limited to 'kernel/sched.c')
-rw-r--r-- | kernel/sched.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/kernel/sched.c b/kernel/sched.c index 16b73635f28f..78f4424b7c43 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)) |
@@ -9306,6 +9306,16 @@ static int sched_rt_global_constraints(void) | |||
9306 | 9306 | ||
9307 | return ret; | 9307 | return ret; |
9308 | } | 9308 | } |
9309 | |||
9310 | int sched_rt_can_attach(struct task_group *tg, struct task_struct *tsk) | ||
9311 | { | ||
9312 | /* Don't accept realtime tasks when there is no way for them to run */ | ||
9313 | if (rt_task(tsk) && tg->rt_bandwidth.rt_runtime == 0) | ||
9314 | return 0; | ||
9315 | |||
9316 | return 1; | ||
9317 | } | ||
9318 | |||
9309 | #else /* !CONFIG_RT_GROUP_SCHED */ | 9319 | #else /* !CONFIG_RT_GROUP_SCHED */ |
9310 | static int sched_rt_global_constraints(void) | 9320 | static int sched_rt_global_constraints(void) |
9311 | { | 9321 | { |
@@ -9399,8 +9409,7 @@ cpu_cgroup_can_attach(struct cgroup_subsys *ss, struct cgroup *cgrp, | |||
9399 | struct task_struct *tsk) | 9409 | struct task_struct *tsk) |
9400 | { | 9410 | { |
9401 | #ifdef CONFIG_RT_GROUP_SCHED | 9411 | #ifdef CONFIG_RT_GROUP_SCHED |
9402 | /* Don't accept realtime tasks when there is no way for them to run */ | 9412 | if (!sched_rt_can_attach(cgroup_tg(cgrp), tsk)) |
9403 | if (rt_task(tsk) && cgroup_tg(cgrp)->rt_bandwidth.rt_runtime == 0) | ||
9404 | return -EINVAL; | 9413 | return -EINVAL; |
9405 | #else | 9414 | #else |
9406 | /* We don't support RT-tasks being in separate groups */ | 9415 | /* We don't support RT-tasks being in separate groups */ |