diff options
-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 | /* |