aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/subr_param.c
diff options
context:
space:
mode:
authorMatthew Dillon <dillon@FreeBSD.org>2001-08-20 00:41:12 +0000
committerMatthew Dillon <dillon@FreeBSD.org>2001-08-20 00:41:12 +0000
commit2f9e4e8025d489474ae350ac90f08d1879050dc0 (patch)
tree4f3fc469468f6ff18e20f33a23a0fca03e1113be /sys/kern/subr_param.c
parenta35671c1976d41190c8ead51cb7676b155dc5c85 (diff)
downloadsrc-2f9e4e8025d489474ae350ac90f08d1879050dc0.tar.gz
src-2f9e4e8025d489474ae350ac90f08d1879050dc0.zip
Limit the amount of KVM reserved for the buffer cache and for swap-meta
information. The default limits only effect machines with > 1GB of ram and can be overriden with two new kernel conf variables VM_SWZONE_SIZE_MAX and VM_BCACHE_SIZE_MAX, or with loader variables kern.maxswzone and kern.maxbcache. This has the effect of leaving more KVM available for sizing NMBCLUSTERS and 'maxusers' and should avoid tripups where a sysad adds memory to a machine and then sees the kernel panic on boot due to running out of KVM. Also change the default swap-meta auto-sizing calculation to allocate half of what it was previously allocating. The prior defaults were way too high. Note that we cannot afford to run out of swap-meta structures so we still stay somewhat conservative here.
Notes
Notes: svn path=/head/; revision=81933
Diffstat (limited to 'sys/kern/subr_param.c')
-rw-r--r--sys/kern/subr_param.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/kern/subr_param.c b/sys/kern/subr_param.c
index 272ca3c13a19..4f755badf2c0 100644
--- a/sys/kern/subr_param.c
+++ b/sys/kern/subr_param.c
@@ -72,6 +72,8 @@ int maxfilesperproc; /* per-proc open files limit */
int ncallout; /* maximum # of timer events */
int nbuf;
int nswbuf;
+int maxswzone; /* max swmeta KVA storage */
+int maxbcache; /* max buffer cache KVA storage */
/*
* These have to be allocated somewhere; allocating
@@ -114,6 +116,10 @@ init_param(void)
/* Cannot be changed after boot */
nbuf = NBUF;
TUNABLE_INT_FETCH("kern.nbuf", &nbuf);
+ maxswzone = VM_SWZONE_SIZE_MAX;
+ TUNABLE_INT_FETCH("kern.maxswzone", &maxswzone);
+ maxbcache = VM_BCACHE_SIZE_MAX;
+ TUNABLE_INT_FETCH("kern.maxbcache", &maxbcache);
ncallout = 16 + maxproc + maxfiles;
TUNABLE_INT_FETCH("kern.ncallout", &ncallout);
}