summaryrefslogtreecommitdiffstats
path: root/sys/kern
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>1996-05-31 00:20:34 +0000
committerpeter <peter@FreeBSD.org>1996-05-31 00:20:34 +0000
commita6023afadfbb05340c7296f1384561e1ecce012e (patch)
treeb446a70fccaa7fb3b4a986f5104bd02c2d030856 /sys/kern
parentb46e8cf885570613bfe0bf9fff30d835444fbf0f (diff)
downloadFreeBSD-src-a6023afadfbb05340c7296f1384561e1ecce012e.zip
FreeBSD-src-a6023afadfbb05340c7296f1384561e1ecce012e.tar.gz
Add an option "EXTRA_VNODES" to cause an extra number of vnode structures
to be allocated at boot time. This is an expensive option, as they consume physical ram and are not pageable etc. In certain situations, this kind of option is quite useful, especially for news servers that access a large number of directories at random and torture the name cache. Defining 5000 or 10000 extra vnodes should cut down the amount of vnode recycling somewhat, which should allow better name and directory caching etc. This is a "your mileage may vary" option, with no real indication of what works best for your machine except trial and error. Too many will cost you ram that you could otherwise use for disk buffers etc. This is based on something John Dyson mentioned to me a while ago.
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/subr_param.c7
-rw-r--r--sys/kern/vfs_export.c4
-rw-r--r--sys/kern/vfs_subr.c4
3 files changed, 10 insertions, 5 deletions
diff --git a/sys/kern/subr_param.c b/sys/kern/subr_param.c
index f86e749..92c06c1 100644
--- a/sys/kern/subr_param.c
+++ b/sys/kern/subr_param.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)param.c 8.3 (Berkeley) 8/20/94
- * $Id: param.c,v 1.18 1996/05/02 14:19:18 phk Exp $
+ * $Id: param.c,v 1.19 1996/05/10 19:28:32 wollman Exp $
*/
#include "opt_sysvipc.h"
@@ -89,6 +89,11 @@ int maxfiles = NPROC*2; /* system wide open files limit */
int maxfilesperproc = NPROC*2; /* per-process open files limit */
int ncallout = 16 + NPROC; /* maximum # of timer events */
+#ifndef EXTRAVNODES
+#define EXTRAVNODES 0
+#endif
+int extravnodes = EXTRAVNODES; /* spare vnodes to allocate */
+
/* maximum # of mbuf clusters */
#ifndef NMBCLUSTERS
#define NMBCLUSTERS (512 + MAXUSERS * 16)
diff --git a/sys/kern/vfs_export.c b/sys/kern/vfs_export.c
index 95e632c..ebebbf5 100644
--- a/sys/kern/vfs_export.c
+++ b/sys/kern/vfs_export.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)vfs_subr.c 8.13 (Berkeley) 4/18/94
- * $Id: vfs_subr.c,v 1.52 1996/01/19 03:58:15 dyson Exp $
+ * $Id: vfs_subr.c,v 1.53 1996/03/09 06:43:19 dyson Exp $
*/
/*
@@ -112,7 +112,7 @@ static int vfs_hang_addrlist __P((struct mount *mp, struct netexport *nep,
void
vntblinit()
{
- desiredvnodes = maxproc + vm_object_cache_max;
+ desiredvnodes = maxproc + vm_object_cache_max + extravnodes;
TAILQ_INIT(&vnode_free_list);
CIRCLEQ_INIT(&mountlist);
diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c
index 95e632c..ebebbf5 100644
--- a/sys/kern/vfs_subr.c
+++ b/sys/kern/vfs_subr.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)vfs_subr.c 8.13 (Berkeley) 4/18/94
- * $Id: vfs_subr.c,v 1.52 1996/01/19 03:58:15 dyson Exp $
+ * $Id: vfs_subr.c,v 1.53 1996/03/09 06:43:19 dyson Exp $
*/
/*
@@ -112,7 +112,7 @@ static int vfs_hang_addrlist __P((struct mount *mp, struct netexport *nep,
void
vntblinit()
{
- desiredvnodes = maxproc + vm_object_cache_max;
+ desiredvnodes = maxproc + vm_object_cache_max + extravnodes;
TAILQ_INIT(&vnode_free_list);
CIRCLEQ_INIT(&mountlist);
OpenPOWER on IntegriCloud