Author: jhb
Date: Tue Dec 24 19:03:30 2013
New Revision: 259836
URL: http://svnweb.freebsd.org/changeset/base/259836

Log:
  MFC 258869:
  Fix an off-by-one error in r228960.  The maximum priority delta provided
  by SCHED_PRI_TICKS should be SCHED_PRI_RANGE - 1 so that the resulting
  priority value (before nice adjustment) is between SCHED_PRI_MIN and
  SCHED_PRI_MAX, inclusive.

Modified:
  stable/8/sys/kern/sched_ule.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/kern/   (props changed)

Modified: stable/8/sys/kern/sched_ule.c
==============================================================================
--- stable/8/sys/kern/sched_ule.c       Tue Dec 24 19:02:04 2013        
(r259835)
+++ stable/8/sys/kern/sched_ule.c       Tue Dec 24 19:03:30 2013        
(r259836)
@@ -1488,7 +1488,7 @@ sched_priority(struct thread *td)
                pri = SCHED_PRI_MIN;
                if (td->td_sched->ts_ticks)
                        pri += min(SCHED_PRI_TICKS(td->td_sched),
-                           SCHED_PRI_RANGE);
+                           SCHED_PRI_RANGE - 1);
                pri += SCHED_PRI_NICE(td->td_proc->p_nice);
                KASSERT(pri >= PRI_MIN_BATCH && pri <= PRI_MAX_BATCH,
                    ("sched_priority: invalid priority %d: nice %d, " 
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to