Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 3 Dec 2013 14:50:13 +0000 (UTC)
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r258869 - head/sys/kern
Message-ID:  <201312031450.rB3EoDZe058396@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jhb
Date: Tue Dec  3 14:50:12 2013
New Revision: 258869
URL: http://svnweb.freebsd.org/changeset/base/258869

Log:
  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.
  
  Submitted by:	kib
  Reported by:	pho
  MFC after:	1 week

Modified:
  head/sys/kern/sched_ule.c

Modified: head/sys/kern/sched_ule.c
==============================================================================
--- head/sys/kern/sched_ule.c	Tue Dec  3 13:38:13 2013	(r258868)
+++ head/sys/kern/sched_ule.c	Tue Dec  3 14:50:12 2013	(r258869)
@@ -1532,7 +1532,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, " 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201312031450.rB3EoDZe058396>