summaryrefslogtreecommitdiff
path: root/sys/kern/init_main.c
diff options
context:
space:
mode:
authorGrigoriy Orlov <gluk@cvs.openbsd.org>2001-09-17 19:17:31 +0000
committerGrigoriy Orlov <gluk@cvs.openbsd.org>2001-09-17 19:17:31 +0000
commit558d8397d514aacccc830c86d8533565610b739f (patch)
tree388011bdec4da74850a23b53d4077fe017f45d53 /sys/kern/init_main.c
parent250b3197be83ce0b4ae75c5b80df4b3fde30dea3 (diff)
The first implementation of the buffer flushing daemon. It solves our
problem when syncer can't do its work because of vnode locks (PR1983). This also solves our problem where bigger number of buffers results in a much worse perfomance. In my configuration (i386, 128mb, BUFCACHEPERCENT=35) this speedup tar -xzf ports.tar.gz in 2-4 times. In configuration with low number of buffers and softupdates this may slowdown some operations up to 15%. The major difference with current buffer cache is that new implementation uses separate queues for dirty and clean buffers. I.e. BQ_LRU and BQ_AGE replaced by BQ_CLEAN and BQ_DIRTY. This simplifies things a lot and doesn't affect perfomance in a bad manner. Thanks to art and costa for pointing on errors. Tested by brad, millert, naddy, art, jj, camield art, millert ok.
Diffstat (limited to 'sys/kern/init_main.c')
-rw-r--r--sys/kern/init_main.c24
1 files changed, 17 insertions, 7 deletions
diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c
index 45c096c2539..4af0d315850 100644
--- a/sys/kern/init_main.c
+++ b/sys/kern/init_main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: init_main.c,v 1.76 2001/09/12 15:48:45 art Exp $ */
+/* $OpenBSD: init_main.c,v 1.77 2001/09/17 19:17:30 gluk Exp $ */
/* $NetBSD: init_main.c,v 1.84.4.1 1996/06/02 09:08:06 mrg Exp $ */
/*
@@ -133,6 +133,7 @@ int main __P((void *));
void check_console __P((struct proc *));
void start_init __P((void *));
void start_pagedaemon __P((void *));
+void start_flusher __P((void *));
void start_update __P((void *));
void start_reaper __P((void *));
void start_crypto __P((void *));
@@ -413,15 +414,16 @@ main(framep)
if (kthread_create(start_reaper, NULL, NULL, "reaper"))
panic("fork reaper");
- /* Create process 4, the update daemon kernel thread. */
- if (kthread_create(start_update, NULL, NULL, "update")) {
-#ifdef DIAGNOSTIC
+ /* Create process 4, the flusher daemon kernel thread. */
+ if (kthread_create(start_flusher, NULL, NULL, "flusher"))
+ panic("fork flusher");
+
+ /* Create process 5, the update daemon kernel thread. */
+ if (kthread_create(start_update, NULL, NULL, "update"))
panic("fork update");
-#endif
- }
#ifdef CRYPTO
- /* Create process 5, the crypto kernel thread. */
+ /* Create process 6, the crypto kernel thread. */
if (kthread_create(start_crypto, NULL, NULL, "crypto"))
panic("crypto thread");
#endif /* CRYPTO */
@@ -618,6 +620,14 @@ start_update(arg)
}
void
+start_flusher(arg)
+ void *arg;
+{
+ buf_daemon(curproc);
+ /* NOTREACHED */
+}
+
+void
start_reaper(arg)
void *arg;
{