Skip to contentSkip to conversation

sched: inaccurate calculation for normal priority

PATCH New jia zhang 1 participant 1 message Nov 24, 2008

lore
Share & tools
lore

jia zhang

author
#0 lore raw

PATCH 1/1 sched: inaccurate calculation for normal priority

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.

---
 b/kernel/sched.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
kernel/sched.c +2 -1
index 9b1e793..b3038e4 100644
@@ -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;