mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [patch] trivial task_prio() fix
@ 2003-03-25  2:14 Robert Love
  2003-03-25  6:25 ` Ingo Molnar
  0 siblings, 1 reply; 2+ messages in thread
From: Robert Love @ 2003-03-25  2:14 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Kernel Mailing List, Ingo Molnar

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 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.

The object code is the same for the 99% of the people who do not touch
the real-time priority defines.

This has been in Andrew's tree for awhile, with no issue.  I have also
posted here to no complaint.  Patch is against 2.5.66, please apply.

	Robert Love


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


diff -urN linux-2.5.66/kernel/sched.c linux/kernel/sched.c
--- linux-2.5.66/kernel/sched.c	2003-03-24 17:01:16.000000000 -0500
+++ linux/kernel/sched.c	2003-03-24 21:09:55.196360600 -0500
@@ -1680,7 +1680,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] 2+ messages in thread

* Re: [patch] trivial task_prio() fix
  2003-03-25  2:14 [patch] trivial task_prio() fix Robert Love
@ 2003-03-25  6:25 ` Ingo Molnar
  0 siblings, 0 replies; 2+ messages in thread
From: Ingo Molnar @ 2003-03-25  6:25 UTC (permalink / raw)
  To: Robert Love; +Cc: Linus Torvalds, Kernel Mailing List


On 24 Mar 2003, Robert Love wrote:

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

looks good to me.

	Ingo


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-03-25  6:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-03-25  2:14 [patch] trivial task_prio() fix Robert Love
2003-03-25  6:25 ` Ingo Molnar

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

all inboxes | Powered by JetHome®