diff options
author | dyson <dyson@FreeBSD.org> | 1997-06-15 17:56:53 +0000 |
---|---|---|
committer | dyson <dyson@FreeBSD.org> | 1997-06-15 17:56:53 +0000 |
commit | eb8e1f5e4ef9200ddb9a6b5da00a52e14013f8f8 (patch) | |
tree | eeee2fc9d75d47696a1cced34c51c39d48b94baa /sys/ufs/lfs/lfs_segment.c | |
parent | d85a7bf572a5808b870fb2878eb9b8674bb321e2 (diff) | |
download | FreeBSD-src-eb8e1f5e4ef9200ddb9a6b5da00a52e14013f8f8.zip FreeBSD-src-eb8e1f5e4ef9200ddb9a6b5da00a52e14013f8f8.tar.gz |
Fix a problem with the VN device. Specifically, the VN device can
cause a problem of spiraling death due to buffer resource limitations.
The vfs_bio code in general had little ability to handle buffer resource
management, and now it does. Also, there are a lot more knobs for tuning the
vfs_bio code now. The knobs came free because of the need that there
always be some immediately available buffers (non-delayed or locked) for
use. Note that the buffer cache code is much less likely to get bogged
down with lots of delayed writes, even more so than before.
Diffstat (limited to 'sys/ufs/lfs/lfs_segment.c')
-rw-r--r-- | sys/ufs/lfs/lfs_segment.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/sys/ufs/lfs/lfs_segment.c b/sys/ufs/lfs/lfs_segment.c index 7c2c0a5..4798303 100644 --- a/sys/ufs/lfs/lfs_segment.c +++ b/sys/ufs/lfs/lfs_segment.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)lfs_segment.c 8.10 (Berkeley) 6/10/95 - * $Id: lfs_segment.c,v 1.20 1997/02/22 09:47:22 peter Exp $ + * $Id: lfs_segment.c,v 1.21 1997/03/23 00:45:17 bde Exp $ */ #include <sys/param.h> @@ -985,6 +985,11 @@ lfs_writeseg(fs, sp) cbp->b_bcount += bp->b_bcount; if (bp->b_flags & B_LOCKED) --locked_queue_count; + if (bp->b_flags & (B_DELWRI|B_LOCKED)) { + --numdirtybuffers; + if (needsbuffer) + vfs_bio_need_satisfy(); + } bp->b_flags &= ~(B_ERROR | B_READ | B_DELWRI | B_LOCKED | B_GATHERED); if (bp->b_flags & B_CALL) { @@ -1059,6 +1064,11 @@ lfs_writesuper(fs) /* XXX Toggle between first two superblocks; for now just write first */ bp->b_dev = i_dev; bp->b_flags |= B_BUSY | B_CALL | B_ASYNC; + if (bp->b_flags & (B_DELWRI|B_LOCKED)) { + --numdirtybuffers; + if (needsbuffer) + vfs_bio_need_satisfy(); + } bp->b_flags &= ~(B_DONE | B_ERROR | B_READ | B_DELWRI); bp->b_iodone = lfs_supercallback; vop_strategy_a.a_desc = VDESC(vop_strategy); |