summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorjeff <jeff@FreeBSD.org>2007-03-17 23:32:48 +0000
committerjeff <jeff@FreeBSD.org>2007-03-17 23:32:48 +0000
commit07c8782e6512760e537cec090a2b9bf957fbd93b (patch)
tree55ef937f0695c9c1def6ec44624d417237f594b9 /sys
parent70052005d278a0312ebd5eeadf04516ebe448cd2 (diff)
downloadFreeBSD-src-07c8782e6512760e537cec090a2b9bf957fbd93b.zip
FreeBSD-src-07c8782e6512760e537cec090a2b9bf957fbd93b.tar.gz
- Handle the case where slptime == runtime.
Submitted by: Atoine Brodin
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/sched_ule.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/kern/sched_ule.c b/sys/kern/sched_ule.c
index c7e94c7..377fc27 100644
--- a/sys/kern/sched_ule.c
+++ b/sys/kern/sched_ule.c
@@ -1220,10 +1220,14 @@ sched_interact_score(struct thread *td)
div = max(1, td->td_sched->skg_runtime / SCHED_INTERACT_HALF);
return (SCHED_INTERACT_HALF +
(SCHED_INTERACT_HALF - (td->td_sched->skg_slptime / div)));
- } if (td->td_sched->skg_slptime > td->td_sched->skg_runtime) {
+ }
+ if (td->td_sched->skg_slptime > td->td_sched->skg_runtime) {
div = max(1, td->td_sched->skg_slptime / SCHED_INTERACT_HALF);
return (td->td_sched->skg_runtime / div);
}
+ /* runtime == slptime */
+ if (td->td_sched->skg_runtime)
+ return (SCHED_INTERACT_HALF);
/*
* This can happen if slptime and runtime are 0.
OpenPOWER on IntegriCloud