sched/core: Fix prio for fair in __task_prio
Commit Message
It is said "120" in the comment, but MAX_RT_PRIO + MAX_NICE equals 119.
DEFAULT_PRIO should be the right prio.
Fix it and imodify the corresponding prio in prio_less.
Signed-off-by: Wang Jinchao <wangjinchao@xfusion.com>
---
kernel/sched/core.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
@@ -168,7 +168,7 @@ static inline int __task_prio(const struct task_struct *p)
if (p->sched_class == &idle_sched_class)
return MAX_RT_PRIO + NICE_WIDTH; /* 140 */
- return MAX_RT_PRIO + MAX_NICE; /* 120, squash fair */
+ return DEFAULT_PRIO; /* 120, squash fair */
}
/*
@@ -194,7 +194,7 @@ static inline bool prio_less(const struct task_struct *a,
if (pa == -1) /* dl_prio() doesn't work because of stop_class above */
return !dl_time_before(a->dl.deadline, b->dl.deadline);
- if (pa == MAX_RT_PRIO + MAX_NICE) /* fair */
+ if (pa == DEFAULT_PRIO) /* fair */
return cfs_prio_less(a, b, in_fi);
return false;