diff options
author | jhb <jhb@FreeBSD.org> | 2013-12-24 19:01:08 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2013-12-24 19:01:08 +0000 |
commit | 4620ae454b718b9bf42934f2b3ffd9723cd6f3b4 (patch) | |
tree | 747c7ef3b7f53fbaefaa0a9fb1c51ffe81aa5391 | |
parent | af9076fcae04f32eb1af04bc27f8dfe1ff99b2c6 (diff) | |
download | FreeBSD-src-4620ae454b718b9bf42934f2b3ffd9723cd6f3b4.zip FreeBSD-src-4620ae454b718b9bf42934f2b3ffd9723cd6f3b4.tar.gz |
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.
-rw-r--r-- | sys/kern/sched_ule.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/kern/sched_ule.c b/sys/kern/sched_ule.c index cba9d80..6b6bbca 100644 --- a/sys/kern/sched_ule.c +++ b/sys/kern/sched_ule.c @@ -1533,7 +1533,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, " |