View | Details | Raw Unified | Return to bug 178997 | Differences between
and this patch

Collapse All | Expand All

(-)sys/kern/vfs_bio.c (-1 / +19 lines)
Lines 1146-1152 Link Here
1146
	if (bo->bo_dirty.bv_cnt > dirtybufthresh + 10) {
1146
	if (bo->bo_dirty.bv_cnt > dirtybufthresh + 10) {
1147
		(void) VOP_FSYNC(bp->b_vp, MNT_NOWAIT, curthread);
1147
		(void) VOP_FSYNC(bp->b_vp, MNT_NOWAIT, curthread);
1148
		altbufferflushes++;
1148
		altbufferflushes++;
1149
	} else if (bo->bo_dirty.bv_cnt > dirtybufthresh) {
1149
	} else if (bdflush_required(bo)) {
1150
		BO_LOCK(bo);
1150
		BO_LOCK(bo);
1151
		/*
1151
		/*
1152
		 * Try to find a buffer to flush.
1152
		 * Try to find a buffer to flush.
Lines 1438-1443 Link Here
1438
}
1438
}
1439
1439
1440
/*
1440
/*
1441
 *	Flushing is deemed necessary if at least one of the following is true:
1442
 *	- bo is hogging more than dirtybufthresh buffers (previous behavior)
1443
 *	- numdirtybuffers exceeds dirtybufthresh
1444
 *	- we are or act as bufdaemon (TDP_NORUNNINGBUF)
1445
 */
1446
int
1447
bdflush_required(struct bufobj *bo)
1448
{
1449
	struct thread *td = curthread;
1450
1451
	KASSERT(bo != NULL, ("bdflush_required: NULL bo"));
1452
1453
	return ((bo->bo_dirty.bv_cnt > dirtybufthresh) ||
1454
	        (numdirtybuffers > dirtybufthresh) ||
1455
	        (td && (td->td_pflags & TDP_NORUNNINGBUF)));
1456
}
1457
1458
/*
1441
 *	brelse:
1459
 *	brelse:
1442
 *
1460
 *
1443
 *	Release a busy buffer and, if requested, free its resources.  The
1461
 *	Release a busy buffer and, if requested, free its resources.  The
(-)sys/sys/buf.h (+1 lines)
Lines 486-491 Link Here
486
void	bdata2bio(struct buf *bp, struct bio *bip);
486
void	bdata2bio(struct buf *bp, struct bio *bip);
487
void	bwillwrite(void);
487
void	bwillwrite(void);
488
int	buf_dirty_count_severe(void);
488
int	buf_dirty_count_severe(void);
489
int	bdflush_required(struct bufobj *bo);
489
void	bremfree(struct buf *);
490
void	bremfree(struct buf *);
490
void	bremfreef(struct buf *);	/* XXX Force bremfree, only for nfs. */
491
void	bremfreef(struct buf *);	/* XXX Force bremfree, only for nfs. */
491
int	bread(struct vnode *, daddr_t, int, struct ucred *, struct buf **);
492
int	bread(struct vnode *, daddr_t, int, struct ucred *, struct buf **);
(-)sys/ufs/ffs/ffs_snapshot.c (-1 / +1 lines)
Lines 2161-2167 Link Here
2161
	struct buf *nbp;
2161
	struct buf *nbp;
2162
	int bp_bdskip;
2162
	int bp_bdskip;
2163
2163
2164
	if (bo->bo_dirty.bv_cnt <= dirtybufthresh)
2164
	if (!bdflush_required(bo))
2165
		return;
2165
		return;
2166
2166
2167
	td = curthread;
2167
	td = curthread;

Return to bug 178997