Commit 7957f703 authored by Robert Love's avatar Robert Love Committed by Linus Torvalds

[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.
parent 778c87e7
......@@ -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;
}
/**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment