summaryrefslogtreecommitdiffstats
path: root/sys/kern
diff options
context:
space:
mode:
authorjeff <jeff@FreeBSD.org>2007-08-20 06:34:20 +0000
committerjeff <jeff@FreeBSD.org>2007-08-20 06:34:20 +0000
commit0f3cc9a72e193e7ade68889ab030729cae2c8ba0 (patch)
tree9e21718aabdf0bf128d14da906ff1bd8ddecf3d6 /sys/kern
parent4140a5b7358b4711c4211ca3cd9df47b89140967 (diff)
downloadFreeBSD-src-0f3cc9a72e193e7ade68889ab030729cae2c8ba0.zip
FreeBSD-src-0f3cc9a72e193e7ade68889ab030729cae2c8ba0.tar.gz
- Set steal_thresh to log2(ncpus). This improves idle-time load balancing
on 2cpu machines by reducing it to 1 by default. This improves loaded operation on 8cpu machines by increasing it to 3 where the extra idle time is not as critical. Approved by: re
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/sched_ule.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/kern/sched_ule.c b/sys/kern/sched_ule.c
index 8569bcd..a2c33dd 100644
--- a/sys/kern/sched_ule.c
+++ b/sys/kern/sched_ule.c
@@ -1328,6 +1328,12 @@ sched_initticks(void *dummy)
incr = 1;
tickincr = incr;
#ifdef SMP
+ /*
+ * Set steal thresh to log2(mp_ncpu) but no greater than 4. This
+ * prevents excess thrashing on large machines and excess idle on
+ * smaller machines.
+ */
+ steal_thresh = min(ffs(mp_ncpus) - 1, 4);
affinity = SCHED_AFFINITY_DEFAULT;
#endif
}
OpenPOWER on IntegriCloud