Commit dad1c65c authored by Con Kolivas's avatar Con Kolivas Committed by Linus Torvalds

[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: default avatarCon Kolivas <kernel@kolivas.org>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Nick Piggin <nickpiggin@yahoo.com.au>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 738a2ccb
...@@ -661,21 +661,21 @@ static int effective_prio(task_t *p) ...@@ -661,21 +661,21 @@ static int effective_prio(task_t *p)
} }
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
static inline void inc_prio_bias(runqueue_t *rq, int static_prio) static inline void inc_prio_bias(runqueue_t *rq, int prio)
{ {
rq->prio_bias += MAX_PRIO - static_prio; rq->prio_bias += MAX_PRIO - prio;
} }
static inline void dec_prio_bias(runqueue_t *rq, int static_prio) static inline void dec_prio_bias(runqueue_t *rq, int prio)
{ {
rq->prio_bias -= MAX_PRIO - static_prio; rq->prio_bias -= MAX_PRIO - prio;
} }
#else #else
static inline void inc_prio_bias(runqueue_t *rq, int static_prio) static inline void inc_prio_bias(runqueue_t *rq, int prio)
{ {
} }
static inline void dec_prio_bias(runqueue_t *rq, int static_prio) static inline void dec_prio_bias(runqueue_t *rq, int prio)
{ {
} }
#endif #endif
...@@ -683,12 +683,18 @@ static inline void dec_prio_bias(runqueue_t *rq, int static_prio) ...@@ -683,12 +683,18 @@ static inline void dec_prio_bias(runqueue_t *rq, int static_prio)
static inline void inc_nr_running(task_t *p, runqueue_t *rq) static inline void inc_nr_running(task_t *p, runqueue_t *rq)
{ {
rq->nr_running++; rq->nr_running++;
if (rt_task(p))
inc_prio_bias(rq, p->prio);
else
inc_prio_bias(rq, p->static_prio); inc_prio_bias(rq, p->static_prio);
} }
static inline void dec_nr_running(task_t *p, runqueue_t *rq) static inline void dec_nr_running(task_t *p, runqueue_t *rq)
{ {
rq->nr_running--; rq->nr_running--;
if (rt_task(p))
dec_prio_bias(rq, p->prio);
else
dec_prio_bias(rq, p->static_prio); dec_prio_bias(rq, p->static_prio);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment