summaryrefslogtreecommitdiffstats
path: root/sys/kern/sched_ule.c
diff options
context:
space:
mode:
authormav <mav@FreeBSD.org>2012-03-09 19:09:08 +0000
committermav <mav@FreeBSD.org>2012-03-09 19:09:08 +0000
commitd6e827162d29c061ab98078be03b5ac55010f7cb (patch)
tree86aa0572932a274b043b644e365e98b76d2b7747 /sys/kern/sched_ule.c
parentf4c01e5c172807e185b31531a0f217324baca521 (diff)
downloadFreeBSD-src-d6e827162d29c061ab98078be03b5ac55010f7cb.zip
FreeBSD-src-d6e827162d29c061ab98078be03b5ac55010f7cb.tar.gz
Make kern.sched.idlespinthresh default value adaptive depending of HZ.
Otherwise with HZ above 8000 CPU may never skip timer ticks on idle.
Diffstat (limited to 'sys/kern/sched_ule.c')
-rw-r--r--sys/kern/sched_ule.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/kern/sched_ule.c b/sys/kern/sched_ule.c
index 8bd2f96..5fb15e35 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
@@ -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);
}
OpenPOWER on IntegriCloud