summaryrefslogtreecommitdiffstats
path: root/sys/kern/vfs_cluster.c
diff options
context:
space:
mode:
authordillon <dillon@FreeBSD.org>2000-12-26 19:41:38 +0000
committerdillon <dillon@FreeBSD.org>2000-12-26 19:41:38 +0000
commitfd223545d4ce7c8c6fe4896ce1eb916f587f77a8 (patch)
tree8bc9147cc365625dec8071f12bd60d2119d819e4 /sys/kern/vfs_cluster.c
parenta042274eabc95cdbaadcbde28ce1b8bdbb79d6f8 (diff)
downloadFreeBSD-src-fd223545d4ce7c8c6fe4896ce1eb916f587f77a8.zip
FreeBSD-src-fd223545d4ce7c8c6fe4896ce1eb916f587f77a8.tar.gz
This implements a better launder limiting solution. There was a solution
in 4.2-REL which I ripped out in -stable and -current when implementing the low-memory handling solution. However, maxlaunder turns out to be the saving grace in certain very heavily loaded systems (e.g. newsreader box). The new algorithm limits the number of pages laundered in the first pageout daemon pass. If that is not sufficient then suceessive will be run without any limit. Write I/O is now pipelined using two sysctls, vfs.lorunningspace and vfs.hirunningspace. This prevents excessive buffered writes in the disk queues which cause long (multi-second) delays for reads. It leads to more stable (less jerky) and generally faster I/O streaming to disk by allowing required read ops (e.g. for indirect blocks and such) to occur without interrupting the write stream, amoung other things. NOTE: eventually, filesystem write I/O pipelining needs to be done on a per-device basis. At the moment it is globalized.
Diffstat (limited to 'sys/kern/vfs_cluster.c')
-rw-r--r--sys/kern/vfs_cluster.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/sys/kern/vfs_cluster.c b/sys/kern/vfs_cluster.c
index 29a1879..088dc40 100644
--- a/sys/kern/vfs_cluster.c
+++ b/sys/kern/vfs_cluster.c
@@ -247,8 +247,12 @@ single_block_read:
printf("S(%ld,%ld,%d) ",
(long)bp->b_lblkno, bp->b_bcount, seqcount);
#endif
- if ((bp->b_flags & B_CLUSTER) == 0)
+ if ((bp->b_flags & B_CLUSTER) == 0) {
vfs_busy_pages(bp, 0);
+ } else {
+ bp->b_runningbufspace = bp->b_bufsize;
+ runningbufspace += bp->b_runningbufspace;
+ }
bp->b_flags &= ~B_INVAL;
bp->b_ioflags &= ~BIO_ERROR;
if ((bp->b_flags & B_ASYNC) || bp->b_iodone != NULL)
@@ -283,8 +287,12 @@ single_block_read:
}
#endif
- if ((rbp->b_flags & B_CLUSTER) == 0)
+ if ((rbp->b_flags & B_CLUSTER) == 0) {
vfs_busy_pages(rbp, 0);
+ } else {
+ rbp->b_runningbufspace = rbp->b_bufsize;
+ runningbufspace += rbp->b_runningbufspace;
+ }
rbp->b_flags &= ~B_INVAL;
rbp->b_ioflags &= ~BIO_ERROR;
if ((rbp->b_flags & B_ASYNC) || rbp->b_iodone != NULL)
OpenPOWER on IntegriCloud