From 0f3cc9a72e193e7ade68889ab030729cae2c8ba0 Mon Sep 17 00:00:00 2001 From: jeff Date: Mon, 20 Aug 2007 06:34:20 +0000 Subject: - 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 --- sys/kern/sched_ule.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'sys/kern') 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 } -- cgit v1.1