From 7957f703dbc8678d68e73d4b6d239675ed1de673 Mon Sep 17 00:00:00 2001 From: Robert Love Date: Sun, 20 Apr 2003 23:24:30 -0700 Subject: [PATCH] [PATCH] trivial task_prio() fix Here is a trivial fix for task_prio() in the case MAX_RT_PRIO != MAX_USER_RT_PRIO. In this case, all priorities are skewed by (MAX_RT_PRIO - MAX_USER_RT_PRIO). The fix is to subtract the full MAX_RT_PRIO value from p->prio, not just MAX_USER_RT_PRIO. This makes sense, as the full priority range is unrelated to the maximum user value. Only the real maximum RT value matters. This has been in Andrew's tree for awhile, with no issue. Also, Ingo acked it. --- kernel/sched.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/sched.c b/kernel/sched.c index ae2dbdf33d7d6..97bbf5eddd5b6 100644 --- a/kernel/sched.c +++ b/kernel/sched.c @@ -1666,7 +1666,7 @@ asmlinkage long sys_nice(int increment) */ int task_prio(task_t *p) { - return p->prio - MAX_USER_RT_PRIO; + return p->prio - MAX_RT_PRIO; } /** -- 2.53.0