[<prev] [next>] [day] [month] [year] [list]
Message-ID: <492A986D.8030809@gmail.com>
Date: Mon, 24 Nov 2008 20:05:01 +0800
From: jia zhang <jia.zhang2008@...il.com>
To: linux-kernel@...r.kernel.org
CC: Ingo Molnar <mingo@...e.hu>
Subject: [PATCH] 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.
Signed-off-by: jia zhang <jia.zhang2008@...il.com>
---
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@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists