summaryrefslogtreecommitdiffstats
path: root/sys/kern/subr_param.c
diff options
context:
space:
mode:
authoralfred <alfred@FreeBSD.org>2013-01-15 19:26:17 +0000
committeralfred <alfred@FreeBSD.org>2013-01-15 19:26:17 +0000
commitc24045a7415012663f450adbe0ae77139d8dee0e (patch)
tree52a94d743c3be86d898915889c3d13abb39f546d /sys/kern/subr_param.c
parent3d394d93b6b9d2125d29b177824a45f084790397 (diff)
downloadFreeBSD-src-c24045a7415012663f450adbe0ae77139d8dee0e.zip
FreeBSD-src-c24045a7415012663f450adbe0ae77139d8dee0e.tar.gz
Do not autotune ncallout to be greater than 18508.
When maxusers was unrestricted and maxfiles was allowed to autotune much higher the result was that ncallout which was based on maxfiles and maxproc grew much higher than was needed. To fix this clip autotuning to the same number we would get with the old maxusers algorithm which would stop scaling at 384 maxusers. Growing ncalout higher is not likely to be needed since most consumers of timeout(9) are gone and any higher value for ncallout causes the callwheel hashes to be much larger than will even be needed for most applications. MFC after: 1 month Reviewed by: mav
Diffstat (limited to 'sys/kern/subr_param.c')
-rw-r--r--sys/kern/subr_param.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/kern/subr_param.c b/sys/kern/subr_param.c
index fcb41e7..7671615 100644
--- a/sys/kern/subr_param.c
+++ b/sys/kern/subr_param.c
@@ -326,8 +326,11 @@ init_param2(long physpages)
/*
* XXX: Does the callout wheel have to be so big?
+ *
+ * Clip callout to result of previous function of maxusers maximum
+ * 384. This is still huge, but acceptable.
*/
- ncallout = 16 + maxproc + maxfiles;
+ ncallout = imin(16 + maxproc + maxfiles, 18508);
TUNABLE_INT_FETCH("kern.ncallout", &ncallout);
/*
OpenPOWER on IntegriCloud