summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjeff <jeff@FreeBSD.org>2004-10-30 12:19:15 +0000
committerjeff <jeff@FreeBSD.org>2004-10-30 12:19:15 +0000
commit917f19c0393a0e4d1ae58b3ae9c9dfedd9aaa20f (patch)
tree9cac6ff120ac2e0487e21dbb3b2735c334e73e31
parentf7da0c44ca54a4a7a7288fb1562aa85cc4ec9058 (diff)
downloadFreeBSD-src-917f19c0393a0e4d1ae58b3ae9c9dfedd9aaa20f.zip
FreeBSD-src-917f19c0393a0e4d1ae58b3ae9c9dfedd9aaa20f.tar.gz
- When choosing a thread on the run queue, check to see if its nice is
outside of the nice threshold due to a recently awoken thread with a lower nice value. This further reduces the amount of time a positively niced thread gets while running in conjunction with a workload that has many short sleeps (ie buildworld).
-rw-r--r--sys/kern/sched_ule.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/kern/sched_ule.c b/sys/kern/sched_ule.c
index fed9c29..a494bcd 100644
--- a/sys/kern/sched_ule.c
+++ b/sys/kern/sched_ule.c
@@ -867,8 +867,9 @@ migrate:
static struct kse *
kseq_choose(struct kseq *kseq)
{
- struct kse *ke;
struct runq *swap;
+ struct kse *ke;
+ int nice;
mtx_assert(&sched_lock, MA_OWNED);
swap = NULL;
@@ -891,7 +892,8 @@ kseq_choose(struct kseq *kseq)
* TIMESHARE kse group and its nice was too far out
* of the range that receives slices.
*/
- if (ke->ke_slice == 0) {
+ nice = ke->ke_proc->p_nice + (0 - kseq->ksq_nicemin);
+ if (ke->ke_slice == 0 || nice > SCHED_SLICE_NTHRESH) {
runq_remove(ke->ke_runq, ke);
sched_slice(ke);
ke->ke_runq = kseq->ksq_next;
OpenPOWER on IntegriCloud