summaryrefslogtreecommitdiffstats
path: root/sys/kern
diff options
context:
space:
mode:
authorgnn <gnn@FreeBSD.org>2015-08-26 16:36:41 +0000
committergnn <gnn@FreeBSD.org>2015-08-26 16:36:41 +0000
commit304a5ae6cb96fedc36fcdc0bdd5692f13581a397 (patch)
tree598e07d840a7e1de5e9f599ee4146d7f8dc5c2c3 /sys/kern
parentff224f98483e01bcc8848a381b3ee9c24751bc5b (diff)
downloadFreeBSD-src-304a5ae6cb96fedc36fcdc0bdd5692f13581a397.zip
FreeBSD-src-304a5ae6cb96fedc36fcdc0bdd5692f13581a397.tar.gz
Summary: Add the interactivity equations to the header comment for our
interactivity calculation routine. Suggested by: rwatson
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/sched_ule.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/sys/kern/sched_ule.c b/sys/kern/sched_ule.c
index 708478f..25c827a 100644
--- a/sys/kern/sched_ule.c
+++ b/sys/kern/sched_ule.c
@@ -1450,6 +1450,21 @@ sched_initticks(void *dummy)
* a [0, 100] integer. This is the voluntary sleep time of a process, which
* differs from the cpu usage because it does not account for time spent
* waiting on a run-queue. Would be prettier if we had floating point.
+ *
+ * When a thread's sleep time is greater than its run time the
+ * calculation is:
+ *
+ * scaling factor
+ * interactivity score = ---------------------
+ * sleep time / run time
+ *
+ *
+ * When a thread's run time is greater than its sleep time the
+ * calculation is:
+ *
+ * scaling factor
+ * interactivity score = --------------------- + scaling factor
+ * run time / sleep time
*/
static int
sched_interact_score(struct thread *td)
OpenPOWER on IntegriCloud