[PATCH] sched: inaccurate calculation for normal priority

From: jia zhang
Date: Mon Nov 24 2008 - 07:05:18 EST



Here we should check to see if the task is a rt ktherad or normal rt process, although right now MAX_USER_RT_PRIO is equal MAX_RT_PRIO.

Signed-off-by: jia zhang <jia.zhang2008@xxxxxxxxx>
---
b/kernel/sched.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/kernel/sched.c b/kernel/sched.c
index 9b1e793..b3038e4 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -1711,7 +1711,8 @@ static inline int normal_prio(struct task_struct *p)
int prio;

if (task_has_rt_policy(p))
- prio = MAX_RT_PRIO-1 - p->rt_priority;
+ prio = p->mm ? MAX_USER_RT_PRIO-1 - p->rt_priority :
+ MAX_RT_PRIO-1 - p->rt_priority;
else
prio = __normal_prio(p);
return prio;

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/