aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sched_rt.c
diff options
context:
space:
mode:
authorDhaval Giani <dhaval@linux.vnet.ibm.com>2008-04-19 13:44:59 -0400
committerIngo Molnar <mingo@elte.hu>2008-04-19 13:44:59 -0400
commit354d60c2ff72d86627dfe2089d186824abf4bb8e (patch)
tree10cea61ce7036448ed7246820c5575df2a61bb3b /kernel/sched_rt.c
parentea736ed5d353d7a3aa1cf8ce4cf8d947bc353fb2 (diff)
sched: mix tasks and groups
This patch allows tasks and groups to exist in the same cfs_rq. With this change the CFS group scheduling follows a 1/(M+N) model from a 1/(1+N) fairness model where M tasks and N groups exist at the cfs_rq level. [a.p.zijlstra@chello.nl: rt bits and assorted fixes] Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com> Signed-off-by: Srivatsa Vaddagiri <vatsa@linux.vnet.ibm.com> Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/sched_rt.c')
-rw-r--r--kernel/sched_rt.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/kernel/sched_rt.c b/kernel/sched_rt.c
index 8ff824565e06..201a69382a42 100644
--- a/kernel/sched_rt.c
+++ b/kernel/sched_rt.c
@@ -374,11 +374,15 @@ static void update_curr_rt(struct rq *rq)
374 curr->se.exec_start = rq->clock; 374 curr->se.exec_start = rq->clock;
375 cpuacct_charge(curr, delta_exec); 375 cpuacct_charge(curr, delta_exec);
376 376
377 spin_lock(&rt_rq->rt_runtime_lock); 377 for_each_sched_rt_entity(rt_se) {
378 rt_rq->rt_time += delta_exec; 378 rt_rq = rt_rq_of_se(rt_se);
379 if (sched_rt_runtime_exceeded(rt_rq)) 379
380 resched_task(curr); 380 spin_lock(&rt_rq->rt_runtime_lock);
381 spin_unlock(&rt_rq->rt_runtime_lock); 381 rt_rq->rt_time += delta_exec;
382 if (sched_rt_runtime_exceeded(rt_rq))
383 resched_task(curr);
384 spin_unlock(&rt_rq->rt_runtime_lock);
385 }
382} 386}
383 387
384static inline 388static inline
@@ -477,7 +481,6 @@ static void dequeue_rt_entity(struct sched_rt_entity *rt_se)
477 * entries, we must remove entries top - down. 481 * entries, we must remove entries top - down.
478 * 482 *
479 * XXX: O(1/2 h^2) because we can only walk up, not down the chain. 483 * XXX: O(1/2 h^2) because we can only walk up, not down the chain.
480 * doesn't matter much for now, as h=2 for GROUP_SCHED.
481 */ 484 */
482static void dequeue_rt_stack(struct task_struct *p) 485static void dequeue_rt_stack(struct task_struct *p)
483{ 486{