sched: inaccurate calculation for normal priority
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.
Signed-off-by jia zhang <[email protected]>
--- b/kernel/sched.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
kernel/sched.c +2 -1
@@ -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;