Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/kern When we auto size the vnode cache, make sure we do ...



details:   https://anonhg.NetBSD.org/src/rev/1171f0d2bc14
branches:  trunk
changeset: 512829:1171f0d2bc14
user:      matt <matt%NetBSD.org@localhost>
date:      Wed Jul 18 00:51:54 2001 +0000

description:
When we auto size the vnode cache, make sure we do it *before* we
init vfs so it can the size into account when creating its hash lists.
This means that for a 2GB system, it'll have a default of 65536 buckets
instead of 2048 and when you have 200,000+ vnodes that makes a significant
difference.

diffstat:

 sys/kern/init_main.c |  23 +++++++++++------------
 1 files changed, 11 insertions(+), 12 deletions(-)

diffs (44 lines):

diff -r dda44740370d -r 1171f0d2bc14 sys/kern/init_main.c
--- a/sys/kern/init_main.c      Tue Jul 17 23:58:30 2001 +0000
+++ b/sys/kern/init_main.c      Wed Jul 18 00:51:54 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: init_main.c,v 1.193 2001/07/15 14:36:06 jdolecek Exp $ */
+/*     $NetBSD: init_main.c,v 1.194 2001/07/18 00:51:54 matt Exp $     */
 
 /*
  * Copyright (c) 1995 Christopher G. Demetriou.  All rights reserved.
@@ -325,6 +325,16 @@
 #if defined(NFSSERVER) || defined(NFS)
        nfs_init();                     /* initialize server/shared data */
 #endif
+#ifdef NVNODE_IMPLICIT
+       /*
+        * If maximum number of vnodes in namei vnode cache is not explicitly
+        * defined in kernel config, adjust the number such as we use roughly
+        * 0.5% of memory for vnode cache (but not less than NVNODE vnodes).
+        */
+       usevnodes = (ptoa((unsigned)physmem) / 200) / sizeof(struct vnode);
+       if (usevnodes > desiredvnodes) 
+               desiredvnodes = usevnodes;
+#endif
        vfsinit();
 
        /* Configure the system hardware.  This will enable interrupts. */
@@ -504,17 +514,6 @@
        start_init_exec = 1;
        wakeup((void *)&start_init_exec);
 
-#ifdef NVNODE_IMPLICIT
-       /*
-        * If maximum number of vnodes in namei vnode cache is not explicitly
-        * defined in kernel config, adjust the number such as we use roughly
-        * 0.5% of memory for vnode cache (but not less than NVNODE vnodes).
-        */
-       usevnodes = (ptoa(physmem) / 200) / sizeof(struct vnode);
-       if (usevnodes > desiredvnodes) 
-               desiredvnodes = usevnodes;
-#endif
-
        /* The scheduler is an infinite loop. */
        uvm_scheduler();
        /* NOTREACHED */



Home | Main Index | Thread Index | Old Index