public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] task_prio() fix
@ 2003-02-20 23:42 Robert Love
  0 siblings, 0 replies; only message in thread
From: Robert Love @ 2003-02-20 23:42 UTC (permalink / raw)
  To: mingo; +Cc: linux-kernel, akpm

Looks like task_prio() should do:

        int task_prio(task_t *p)
        {
        	return p->prio - MAX_RT_PRIO;
        }

Instead of subtracting MAX_USER_RT_PRIO, since the maximum _user_ value
has nothing to do with the maximum that may be stored.  The effect is if
MAX_RT_PRIO != MAX_USER_RT_PRIO, then all priorities are skewed by
(MAX_RT_PRIO - MAX_USER_RT_PRIO).

Ingo, this looks trivial to me... but I swear it _used_ to work and this
function has always been like this.  Comments?

Patch is against 2.5.62.

	Robert Love


 kernel/sched.c |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)


diff -urN linux-2.5.62/kernel/sched.c linux/kernel/sched.c
--- linux-2.5.62/kernel/sched.c	2003-02-20 18:30:08.232619488 -0500
+++ linux/kernel/sched.c	2003-02-20 18:30:15.585501680 -0500
@@ -1552,7 +1552,7 @@
  */
 int task_prio(task_t *p)
 {
-	return p->prio - MAX_USER_RT_PRIO;
+	return p->prio - MAX_RT_PRIO;
 }
 
 /**




^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-02-20 23:32 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-02-20 23:42 [patch] task_prio() fix Robert Love

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox