Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys adjust maximum number of vnodes in vnode cache according
details: https://anonhg.NetBSD.org/src/rev/52a54572697f
branches: trunk
changeset: 494416:52a54572697f
user: jdolecek <jdolecek%NetBSD.org@localhost>
date: Thu Jul 06 09:51:54 2000 +0000
description:
adjust maximum number of vnodes in vnode cache according
to machine memory size upon boot if the number has not been specified
explicitly in kernel config - at this moment, 0.5% of system
memory is used for vnodes (but minimum NVNODE vnodes)
diffstat:
sys/kern/init_main.c | 16 +++++++++++++++-
sys/sys/param.h | 3 ++-
2 files changed, 17 insertions(+), 2 deletions(-)
diffs (54 lines):
diff -r 32cfc901bc49 -r 52a54572697f sys/kern/init_main.c
--- a/sys/kern/init_main.c Thu Jul 06 08:20:51 2000 +0000
+++ b/sys/kern/init_main.c Thu Jul 06 09:51:54 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: init_main.c,v 1.174 2000/06/27 17:41:12 mrg Exp $ */
+/* $NetBSD: init_main.c,v 1.175 2000/07/06 09:51:55 jdolecek Exp $ */
/*
* Copyright (c) 1995 Christopher G. Demetriou. All rights reserved.
@@ -188,6 +188,9 @@
#if defined(NFSSERVER) || defined(NFS)
extern void nfs_init __P((void));
#endif
+#ifdef NVNODE_IMPLICIT
+ int usevnodes;
+#endif
/*
* Initialize the current process pointer (curproc) before
@@ -497,6 +500,17 @@
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 */
diff -r 32cfc901bc49 -r 52a54572697f sys/sys/param.h
--- a/sys/sys/param.h Thu Jul 06 08:20:51 2000 +0000
+++ b/sys/sys/param.h Thu Jul 06 09:51:54 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: param.h,v 1.101 2000/06/30 07:44:06 veego Exp $ */
+/* $NetBSD: param.h,v 1.102 2000/07/06 09:51:54 jdolecek Exp $ */
/*-
* Copyright (c) 1982, 1986, 1989, 1993
@@ -131,6 +131,7 @@
#endif
#ifndef NVNODE
#define NVNODE (NPROC + NTEXT + 100)
+#define NVNODE_IMPLICIT
#endif
#endif /* _KERNEL */
Home |
Main Index |
Thread Index |
Old Index