summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>2001-12-19 01:31:12 +0000
committerpeter <peter@FreeBSD.org>2001-12-19 01:31:12 +0000
commit12f2610cb5fd215c51d36de2cbe51871b7b98f5d (patch)
tree453a1928686abed90a1e485ce457ef1a21d92127 /sys
parentbf71f604c6e6f5c1866c862c5a93dbc1cd482913 (diff)
downloadFreeBSD-src-12f2610cb5fd215c51d36de2cbe51871b7b98f5d.zip
FreeBSD-src-12f2610cb5fd215c51d36de2cbe51871b7b98f5d.tar.gz
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.
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/kern_kthread.c1
-rw-r--r--sys/kern/vfs_subr.c18
2 files changed, 15 insertions, 4 deletions
diff --git a/sys/kern/kern_kthread.c b/sys/kern/kern_kthread.c
index b5ed8d4..09fcbad 100644
--- a/sys/kern/kern_kthread.c
+++ b/sys/kern/kern_kthread.c
@@ -149,6 +149,7 @@ kthread_suspend(struct proc *p, int timo)
return (EINVAL);
}
SIGADDSET(p->p_siglist, SIGSTOP);
+ wakeup(p);
return msleep(&p->p_siglist, &p->p_mtx, PPAUSE | PDROP, "suspkt", timo);
}
diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c
index ae297f0..840cac8 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);
}
/*
OpenPOWER on IntegriCloud