summaryrefslogtreecommitdiff
path: root/sys/kern
diff options
context:
space:
mode:
authorJoel Sing <jsing@cvs.openbsd.org>2012-12-28 14:05:40 +0000
committerJoel Sing <jsing@cvs.openbsd.org>2012-12-28 14:05:40 +0000
commit6f7a3f8e917f0ca577a2ff6901a511c6c4085553 (patch)
tree7fe7fa7d84ad4c2edc1995f200440cafad955deb /sys/kern
parent3b818e35b917be29e9bea7603fbe7c6d65b2537f (diff)
Avoid spinning in the cleaner when there are insufficient clean pages, but
there are no buffers on the dirty queue to clean. ok beck@
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/vfs_bio.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c
index 94fe0b88f3f..19898b30041 100644
--- a/sys/kern/vfs_bio.c
+++ b/sys/kern/vfs_bio.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vfs_bio.c,v 1.141 2012/12/02 19:42:36 beck Exp $ */
+/* $OpenBSD: vfs_bio.c,v 1.142 2012/12/28 14:05:39 jsing Exp $ */
/* $NetBSD: vfs_bio.c,v 1.44 1996/06/11 11:15:36 pk Exp $ */
/*
@@ -1083,15 +1083,15 @@ void
buf_daemon(struct proc *p)
{
struct timeval starttime, timediff;
- struct buf *bp;
- int s, pushed;
+ struct buf *bp = NULL;
+ int s, pushed = 0;
cleanerproc = curproc;
- pushed = 16;
s = splbio();
for (;;) {
- if (pushed >= 16 && (UNCLEAN_PAGES < hidirtypages &&
+ if (bp == NULL || (pushed >= 16 &&
+ UNCLEAN_PAGES < hidirtypages &&
bcstats.kvaslots_avail > 2 * RESERVE_SLOTS)){
pushed = 0;
/*
@@ -1151,8 +1151,6 @@ buf_daemon(struct proc *p)
break;
}
- if (bp == NULL)
- pushed = 16; /* No dirty bufs - sleep */
}
}