aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/vfs_subr.c
diff options
context:
space:
mode:
authorPeter Wemm <peter@FreeBSD.org>2001-12-19 01:31:12 +0000
committerPeter Wemm <peter@FreeBSD.org>2001-12-19 01:31:12 +0000
commit8f0d41d324137c87f2e7ec4cb82f7d77f6caf353 (patch)
tree453a1928686abed90a1e485ce457ef1a21d92127 /sys/kern/vfs_subr.c
parentc8e555ec14ee277434ebeaf45156bfab40cfd4fc (diff)
downloadsrc-8f0d41d324137c87f2e7ec4cb82f7d77f6caf353.tar.gz
src-8f0d41d324137c87f2e7ec4cb82f7d77f6caf353.zip
Use a different mechanism to get the vnlru process to wake up and notice
the shutdown request at reboot/halt time. Disable the printf 'vnlru process getting nowhere, pausing...' and instead export the count to the debug.vnlru_nowhere sysctl.
Notes
Notes: svn path=/head/; revision=88160
Diffstat (limited to 'sys/kern/vfs_subr.c')
-rw-r--r--sys/kern/vfs_subr.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c
index ae297f0b1723..840cac8bd9cf 100644
--- a/sys/kern/vfs_subr.c
+++ b/sys/kern/vfs_subr.c
@@ -247,6 +247,9 @@ SYSCTL_INT(_kern, KERN_MAXVNODES, maxvnodes, CTLFLAG_RW,
static int minvnodes;
SYSCTL_INT(_kern, OID_AUTO, minvnodes, CTLFLAG_RW,
&minvnodes, 0, "Minimum number of vnodes");
+static int vnlru_nowhere = 0;
+SYSCTL_INT(_debug, OID_AUTO, vnlru_nowhere, CTLFLAG_RW, &vnlru_nowhere, 0,
+ "Number of times the vnlru process ran without success");
/*
* Initialize the vnode management data structures.
@@ -594,7 +597,7 @@ vnlru_proc(void)
kthread_suspend_check(p);
if (numvnodes - freevnodes <= desiredvnodes * 9 / 10) {
vnlruproc_sig = 0;
- tsleep(&vnlruproc, PVFS, "vlruwt", hz);
+ tsleep(vnlruproc, PVFS, "vlruwt", 0);
continue;
}
done = 0;
@@ -611,8 +614,15 @@ vnlru_proc(void)
}
mtx_unlock(&mountlist_mtx);
if (done == 0) {
- printf("vnlru process getting nowhere, pausing..\n");
- tsleep(&vnlru_proc, PPAUSE, "vlrup", hz * 3);
+#if 0
+ /* These messages are temporary debugging aids */
+ if (vnlru_nowhere < 5)
+ printf("vnlru process getting nowhere..\n");
+ else if (vnlru_nowhere == 5)
+ printf("vnlru process messages stopped.\n");
+#endif
+ vnlru_nowhere++;
+ tsleep(vnlru_proc, PPAUSE, "vlrup", hz * 3);
}
}
splx(s);
@@ -655,7 +665,7 @@ getnewvnode(tag, mp, vops, vpp)
*/
if (vnlruproc_sig == 0 && numvnodes - freevnodes > desiredvnodes) {
vnlruproc_sig = 1; /* avoid unnecessary wakeups */
- wakeup(&vnlruproc);
+ wakeup(vnlruproc);
}
/*