Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-1-5]: src/sys pullup from trunk (approved by thorpej):
details: https://anonhg.NetBSD.org/src/rev/caa9015a77cc
branches: netbsd-1-5
changeset: 488690:caa9015a77cc
user: jdolecek <jdolecek%NetBSD.org@localhost>
date: Mon Jul 24 20:32:19 2000 +0000
description:
pullup from trunk (approved by thorpej):
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 973fe056c693 -r caa9015a77cc sys/kern/init_main.c
--- a/sys/kern/init_main.c Mon Jul 24 20:21:46 2000 +0000
+++ b/sys/kern/init_main.c Mon Jul 24 20:32:19 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: init_main.c,v 1.172.2.1 2000/07/14 18:10:50 thorpej Exp $ */
+/* $NetBSD: init_main.c,v 1.172.2.2 2000/07/24 20:32:19 jdolecek Exp $ */
/*
* Copyright (c) 1995 Christopher G. Demetriou. All rights reserved.
@@ -192,6 +192,9 @@
#if defined(NFSSERVER) || defined(NFS)
extern void nfs_init(void);
#endif
+#ifdef NVNODE_IMPLICIT
+ int usevnodes;
+#endif
/*
* Initialize the current process pointer (curproc) before
@@ -504,6 +507,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 973fe056c693 -r caa9015a77cc sys/sys/param.h
--- a/sys/sys/param.h Mon Jul 24 20:21:46 2000 +0000
+++ b/sys/sys/param.h Mon Jul 24 20:32:19 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: param.h,v 1.98.2.1 2000/06/20 12:39:31 fvdl Exp $ */
+/* $NetBSD: param.h,v 1.98.2.2 2000/07/24 20:32:22 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