summaryrefslogtreecommitdiffstats
path: root/kernel/sched.c
diff options
context:
space:
mode:
authorCon Kolivas <kernel@kolivas.org>2005-11-08 21:38:57 -0800
committerLinus Torvalds <torvalds@g5.osdl.org>2005-11-09 07:56:32 -0800
commitdad1c65c8000f4485d8602e1875ded77e0d72133 (patch)
tree2981648916055ac92bb809b88957ff429764dc02 /kernel/sched.c
parent738a2ccbcf8c2c1b039f1e76662dce60b22b694b (diff)
downloadop-kernel-dev-dad1c65c8000f4485d8602e1875ded77e0d72133.zip
op-kernel-dev-dad1c65c8000f4485d8602e1875ded77e0d72133.tar.gz
[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/sched.c')
-rw-r--r--kernel/sched.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/kernel/sched.c b/kernel/sched.c
index e1f57bd..d9dbf8e 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -661,21 +661,21 @@ static int effective_prio(task_t *p)
}
#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
-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
@@ -683,13 +683,19 @@ static inline void dec_prio_bias(runqueue_t *rq, int static_prio)
static inline void inc_nr_running(task_t *p, runqueue_t *rq)
{
rq->nr_running++;
- inc_prio_bias(rq, p->static_prio);
+ if (rt_task(p))
+ inc_prio_bias(rq, p->prio);
+ else
+ inc_prio_bias(rq, p->static_prio);
}
static inline void dec_nr_running(task_t *p, runqueue_t *rq)
{
rq->nr_running--;
- dec_prio_bias(rq, p->static_prio);
+ if (rt_task(p))
+ dec_prio_bias(rq, p->prio);
+ else
+ dec_prio_bias(rq, p->static_prio);
}
/*
OpenPOWER on IntegriCloud