]> git.hungrycats.org Git - linux/commitdiff
[PATCH] trivial task_prio() fix
authorRobert Love <rml@tech9.net>
Mon, 21 Apr 2003 06:24:30 +0000 (23:24 -0700)
committerLinus Torvalds <torvalds@home.transmeta.com>
Mon, 21 Apr 2003 06:24:30 +0000 (23:24 -0700)
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

index ae2dbdf33d7d60351e81188391b06d34714aecc7..97bbf5eddd5b6837e1275d3896c889420b361778 100644 (file)
@@ -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;
 }
 
 /**