aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorCon Kolivas <kernel@kolivas.org>2005-11-09 00:38:57 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2005-11-09 10:56:32 -0500
commitdad1c65c8000f4485d8602e1875ded77e0d72133 (patch)
tree2981648916055ac92bb809b88957ff429764dc02 /kernel
parent738a2ccbcf8c2c1b039f1e76662dce60b22b694b (diff)
[PATCH] sched: account rt tasks in prio_bias()
Real time tasks' effect on prio_bias should be based on their real time priority level instead of their static_prio which is based on nice. Signed-off-by: Con Kolivas <kernel@kolivas.org> Cc: Ingo Molnar <mingo@elte.hu> Cc: Nick Piggin <nickpiggin@yahoo.com.au> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/sched.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/kernel/sched.c b/kernel/sched.c
index e1f57bd5aaa6..d9dbf8ee6ca4 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -661,21 +661,21 @@ static int effective_prio(task_t *p)
661} 661}
662 662
663#ifdef CONFIG_SMP 663#ifdef CONFIG_SMP
664static inline void inc_prio_bias(runqueue_t *rq, int static_prio) 664static inline void inc_prio_bias(runqueue_t *rq, int prio)
665{ 665{
666 rq->prio_bias += MAX_PRIO - static_prio; 666 rq->prio_bias += MAX_PRIO - prio;
667} 667}
668 668
669static inline void dec_prio_bias(runqueue_t *rq, int static_prio) 669static inline void dec_prio_bias(runqueue_t *rq, int prio)
670{ 670{
671 rq->prio_bias -= MAX_PRIO - static_prio; 671 rq->prio_bias -= MAX_PRIO - prio;
672} 672}
673#else 673#else
674static inline void inc_prio_bias(runqueue_t *rq, int static_prio) 674static inline void inc_prio_bias(runqueue_t *rq, int prio)
675{ 675{
676} 676}
677 677
678static inline void dec_prio_bias(runqueue_t *rq, int static_prio) 678static inline void dec_prio_bias(runqueue_t *rq, int prio)
679{ 679{
680} 680}
681#endif 681#endif
@@ -683,13 +683,19 @@ static inline void dec_prio_bias(runqueue_t *rq, int static_prio)
683static inline void inc_nr_running(task_t *p, runqueue_t *rq) 683static inline void inc_nr_running(task_t *p, runqueue_t *rq)
684{ 684{
685 rq->nr_running++; 685 rq->nr_running++;
686 inc_prio_bias(rq, p->static_prio); 686 if (rt_task(p))
687 inc_prio_bias(rq, p->prio);
688 else
689 inc_prio_bias(rq, p->static_prio);
687} 690}
688 691
689static inline void dec_nr_running(task_t *p, runqueue_t *rq) 692static inline void dec_nr_running(task_t *p, runqueue_t *rq)
690{ 693{
691 rq->nr_running--; 694 rq->nr_running--;
692 dec_prio_bias(rq, p->static_prio); 695 if (rt_task(p))
696 dec_prio_bias(rq, p->prio);
697 else
698 dec_prio_bias(rq, p->static_prio);
693} 699}
694 700
695/* 701/*