diff options
author | Con Kolivas <kernel@kolivas.org> | 2005-11-09 00:38:57 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-11-09 10:56:32 -0500 |
commit | dad1c65c8000f4485d8602e1875ded77e0d72133 (patch) | |
tree | 2981648916055ac92bb809b88957ff429764dc02 /kernel | |
parent | 738a2ccbcf8c2c1b039f1e76662dce60b22b694b (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.c | 22 |
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 |
664 | static inline void inc_prio_bias(runqueue_t *rq, int static_prio) | 664 | static 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 | ||
669 | static inline void dec_prio_bias(runqueue_t *rq, int static_prio) | 669 | static 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 |
674 | static inline void inc_prio_bias(runqueue_t *rq, int static_prio) | 674 | static inline void inc_prio_bias(runqueue_t *rq, int prio) |
675 | { | 675 | { |
676 | } | 676 | } |
677 | 677 | ||
678 | static inline void dec_prio_bias(runqueue_t *rq, int static_prio) | 678 | static 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) | |||
683 | static inline void inc_nr_running(task_t *p, runqueue_t *rq) | 683 | static 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 | ||
689 | static inline void dec_nr_running(task_t *p, runqueue_t *rq) | 692 | static 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 | /* |