Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b68aa2300cabeb96801369a4bb37a4f19f59ed84
Commit:     b68aa2300cabeb96801369a4bb37a4f19f59ed84
Parent:     bccbe08a60973c873e6af6fdb9ec11ffb1a6e4de
Author:     Peter Zijlstra <[EMAIL PROTECTED]>
AuthorDate: Wed Feb 13 15:45:40 2008 +0100
Committer:  Ingo Molnar <[EMAIL PROTECTED]>
CommitDate: Wed Feb 13 15:45:40 2008 +0100

    sched: rt-group: refure unrunnable tasks
    
    Refuse to accept or create RT tasks in groups that can't run them.
    
    Signed-off-by: Peter Zijlstra <[EMAIL PROTECTED]>
    Signed-off-by: Ingo Molnar <[EMAIL PROTECTED]>
---
 kernel/sched.c |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/kernel/sched.c b/kernel/sched.c
index d2f4398..f28f19e 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -4584,6 +4584,15 @@ recheck:
                        return -EPERM;
        }
 
+#ifdef CONFIG_RT_GROUP_SCHED
+       /*
+        * Do not allow realtime tasks into groups that have no runtime
+        * assigned.
+        */
+       if (rt_policy(policy) && task_group(p)->rt_runtime == 0)
+               return -EPERM;
+#endif
+
        retval = security_task_setscheduler(p, policy, param);
        if (retval)
                return retval;
@@ -8028,9 +8037,15 @@ static int
 cpu_cgroup_can_attach(struct cgroup_subsys *ss, struct cgroup *cgrp,
                      struct task_struct *tsk)
 {
+#ifdef CONFIG_RT_GROUP_SCHED
+       /* Don't accept realtime tasks when there is no way for them to run */
+       if (rt_task(tsk) && cgroup_tg(cgrp)->rt_runtime == 0)
+               return -EINVAL;
+#else
        /* We don't support RT-tasks being in separate groups */
        if (tsk->sched_class != &fair_sched_class)
                return -EINVAL;
+#endif
 
        return 0;
 }
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to