From 2ed0341cb6e75ed7ed09adaad52215c904aca7e5 Mon Sep 17 00:00:00 2001 From: mav Date: Mon, 4 Jun 2012 07:12:36 +0000 Subject: [PATCH] MFC r232740: Make kern.sched.idlespinthresh default value adaptive depending of HZ. Otherwise with HZ above 8000 CPU may never skip timer ticks on idle. git-svn-id: svn://svn.freebsd.org/base/stable/9@236546 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- sys/kern/sched_ule.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/kern/sched_ule.c b/sys/kern/sched_ule.c index b3b89bc32..342bb200e 100644 --- a/sys/kern/sched_ule.c +++ b/sys/kern/sched_ule.c @@ -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 @@ -1410,6 +1410,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); } -- 2.45.0