svn commit: r232740 - head/sys/kern

Alexander Motin mav at FreeBSD.org
Fri Mar 9 19:09:09 UTC 2012


Author: mav
Date: Fri Mar  9 19:09:08 2012
New Revision: 232740
URL: http://svn.freebsd.org/changeset/base/232740

Log:
  Make kern.sched.idlespinthresh default value adaptive depending of HZ.
  Otherwise with HZ above 8000 CPU may never skip timer ticks on idle.

Modified:
  head/sys/kern/sched_ule.c

Modified: head/sys/kern/sched_ule.c
==============================================================================
--- head/sys/kern/sched_ule.c	Fri Mar  9 18:50:49 2012	(r232739)
+++ head/sys/kern/sched_ule.c	Fri Mar  9 19:09:08 2012	(r232740)
@@ -212,7 +212,7 @@ static int preempt_thresh = 0;
 #endif
 static int static_boost = PRI_MIN_BATCH;
 static int sched_idlespins = 10000;
-static int sched_idlespinthresh = 16;
+static int sched_idlespinthresh = -1;
 
 /*
  * tdq - per processor runqs and statistics.  All fields are protected by the
@@ -1390,6 +1390,8 @@ sched_initticks(void *dummy)
 	steal_thresh = min(fls(mp_ncpus) - 1, 3);
 	affinity = SCHED_AFFINITY_DEFAULT;
 #endif
+	if (sched_idlespinthresh < 0)
+		sched_idlespinthresh = max(16, 2 * hz / realstathz);
 }
 
 


More information about the svn-src-all mailing list