summaryrefslogtreecommitdiffstats
path: root/sys/kern/sched_ule.c
diff options
context:
space:
mode:
authorjeff <jeff@FreeBSD.org>2003-10-16 08:17:43 +0000
committerjeff <jeff@FreeBSD.org>2003-10-16 08:17:43 +0000
commitbf29a9dd12c09202074e962807f15097f0ae53e3 (patch)
tree15ab3e56472a0666dc8187030124ca6e4a184824 /sys/kern/sched_ule.c
parentd00fd6c26e785df586d947bab4a97345e476858a (diff)
downloadFreeBSD-src-bf29a9dd12c09202074e962807f15097f0ae53e3.zip
FreeBSD-src-bf29a9dd12c09202074e962807f15097f0ae53e3.tar.gz
- The non iterative algorithm for interact_update was broken due to
rounding errors. This was the source of the majority of the interactivity problems. Reintroduce the old algorithm and its XXX. - Up the interactivity threshold to 30. It really could stand to be even a tiny bit higher. - Let the sleep and run time accumulate up to 5 seconds of history rather than two. This helps stop XFree86 from becoming non-interactive during bursts of activity.
Diffstat (limited to 'sys/kern/sched_ule.c')
-rw-r--r--sys/kern/sched_ule.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/sys/kern/sched_ule.c b/sys/kern/sched_ule.c
index c0e2044..1f6a4d0 100644
--- a/sys/kern/sched_ule.c
+++ b/sys/kern/sched_ule.c
@@ -150,11 +150,11 @@ struct td_sched *thread0_sched = &td_sched;
* INTERACT_MAX: Maximum interactivity value. Smaller is better.
* INTERACT_THRESH: Threshhold for placement on the current runq.
*/
-#define SCHED_SLP_RUN_MAX ((hz * 2) << 10)
+#define SCHED_SLP_RUN_MAX ((hz * 5) << 10)
#define SCHED_SLP_RUN_THROTTLE (100)
#define SCHED_INTERACT_MAX (100)
#define SCHED_INTERACT_HALF (SCHED_INTERACT_MAX / 2)
-#define SCHED_INTERACT_THRESH (20)
+#define SCHED_INTERACT_THRESH (30)
/*
* These parameters and macros determine the size of the time slice that is
@@ -674,12 +674,10 @@ sched_slice(struct kse *ke)
static void
sched_interact_update(struct ksegrp *kg)
{
- int ratio;
- if ((kg->kg_runtime + kg->kg_slptime) > SCHED_SLP_RUN_MAX) {
- ratio = (SCHED_SLP_RUN_MAX /
- (kg->kg_runtime + kg->kg_slptime)) * 4;
- kg->kg_runtime = (kg->kg_runtime * ratio) / 5;
- kg->kg_slptime = (kg->kg_slptime * ratio) / 5;
+ /* XXX Fixme, use a linear algorithm and not a while loop. */
+ while ((kg->kg_runtime + kg->kg_slptime) > SCHED_SLP_RUN_MAX) {
+ kg->kg_runtime = (kg->kg_runtime / 5) * 4;
+ kg->kg_slptime = (kg->kg_slptime / 5) * 4;
}
}
OpenPOWER on IntegriCloud