summaryrefslogtreecommitdiffstats
path: root/sys/kern
diff options
context:
space:
mode:
authorobrien <obrien@FreeBSD.org>2004-08-02 21:52:43 +0000
committerobrien <obrien@FreeBSD.org>2004-08-02 21:52:43 +0000
commit47f728c0bc17917916748b0d7360860e771bcccf (patch)
tree26ea4172efd1ac175ef3e0ca7f0f88d2004451a5 /sys/kern
parent022dd0e2edfbed0a5ce1d09e9a5008a6f4627bbd (diff)
downloadFreeBSD-src-47f728c0bc17917916748b0d7360860e771bcccf.zip
FreeBSD-src-47f728c0bc17917916748b0d7360860e771bcccf.tar.gz
Put a cap on the auto-tuning of kern.maxvnodes.
Cap value chosen by: scottl
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/vfs_subr.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c
index 4d67de0..52f564f 100644
--- a/sys/kern/vfs_subr.c
+++ b/sys/kern/vfs_subr.c
@@ -257,6 +257,8 @@ int (*softdep_process_worklist_hook)(struct mount *);
/*
* Initialize the vnode management data structures.
*/
+#define MAX_SAFE_MAXVNODES 100000
+
static void
vntblinit(void *dummy __unused)
{
@@ -270,6 +272,12 @@ vntblinit(void *dummy __unused)
*/
desiredvnodes = min(maxproc + cnt.v_page_count / 4, 2 * vm_kmem_size /
(5 * (sizeof(struct vm_object) + sizeof(struct vnode))));
+ if (desiredvnodes > MAX_SAFE_MAXVNODES) {
+ if (bootverbose)
+ printf("Reducing kern.maxvnodes %d -> %d\n",
+ desiredvnodes, MAX_SAFE_MAXVNODES);
+ desiredvnodes = MAX_SAFE_MAXVNODES;
+ }
minvnodes = desiredvnodes / 4;
mtx_init(&mountlist_mtx, "mountlist", NULL, MTX_DEF);
mtx_init(&mntid_mtx, "mntid", NULL, MTX_DEF);
OpenPOWER on IntegriCloud