summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortholo <tholo@openbsd.org>1996-06-26 19:44:59 +0000
committertholo <tholo@openbsd.org>1996-06-26 19:44:59 +0000
commitf9fa4019fc32d962317c1afac639d27868e516a7 (patch)
tree69f27d034f8f5bf97a25f2373f4c0d03fb24741f
parentPrint empty TCP flags checks (like '/SA' ) properly (diff)
downloadwireguard-openbsd-f9fa4019fc32d962317c1afac639d27868e516a7.tar.xz
wireguard-openbsd-f9fa4019fc32d962317c1afac639d27868e516a7.zip
When a dirty buffer is written to, don't move it to the tail of the
dirty list. Doing that can, for a block that is written to with a period of less than 30 seconds, cause the block to never be flushed to disk. Idea from Jeffrey Mogul's paper covering the same basic changes.
-rw-r--r--sys/kern/vfs_bio.c23
1 files changed, 1 insertions, 22 deletions
diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c
index d0d1b1efd0a..f2db58ffa1d 100644
--- a/sys/kern/vfs_bio.c
+++ b/sys/kern/vfs_bio.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vfs_bio.c,v 1.7 1996/06/14 06:36:24 deraadt Exp $ */
+/* $OpenBSD: vfs_bio.c,v 1.8 1996/06/26 19:44:59 tholo Exp $ */
/* $NetBSD: vfs_bio.c,v 1.44 1996/06/11 11:15:36 pk Exp $ */
/*-
@@ -404,27 +404,6 @@ bdwrite(bp)
curproc->p_stats->p_ru.ru_oublock++; /* XXX */
reassignbuf(bp, bp->b_vp);
}
- else {
- /*
- * The buffer has been rewritten. Move it to the
- * end of the dirty block list, and if it was the
- * first entry before being moved, reschedule the
- * timeout
- */
- if (bdirties.tqh_first == bp) {
- untimeout((void (*)__P((void *)))wakeup,
- &bdirties);
- setit = 1;
- }
- else
- setit = 0;
- TAILQ_REMOVE(&bdirties, bp, b_synclist);
- TAILQ_INSERT_TAIL(&bdirties, bp, b_synclist);
- if (setit && bdirties.tqh_first != bp)
- timeout((void (*)__P((void *)))wakeup,
- &bdirties,
- (bdirties.tqh_first->b_synctime - time.tv_sec) * hz);
- }
/* If this is a tape block, write the block now. */
if (bdevsw[major(bp->b_dev)].d_type == D_TAPE) {