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

Collapse All | Expand All

(-)sys/kern/vfs_bio.c (-1 / +23 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
 * Used by bufbdflush (above) and ffs_bdflush (in ffs_snapshot).
1447
 */
1448
int
1449
bdflush_required(struct bufobj *bo)
1450
{
1451
  struct thread *td = curthread;
1452
1453
  KASSERT(bo != NULL, ("bdflush_required: NULL bo"));
1454
1455
  if ((bo->bo_dirty.bv_cnt > dirtybufthresh) ||
1456
      (numdirtybuffers > dirtybufthresh) ||
1457
      (td && (td->td_pflags & TDP_NORUNNINGBUF)) )
1458
    return(1);
1459
  return(0);
1460
  }
1461
1462
/*
1441
 *	brelse:
1463
 *	brelse:
1442
 *
1464
 *
1443
 *	Release a busy buffer and, if requested, free its resources.  The
1465
 *	Release a busy buffer and, if requested, free its resources.  The
(-)sys/sys/bio.h (+4 lines)
Lines 151-156 Link Here
151
#define physread physio
151
#define physread physio
152
#define physwrite physio
152
#define physwrite physio
153
153
154
extern struct bufobj *bo;
155
int bdflush_required(struct bufobj *bo);
156
157
154
#endif /* _KERNEL */
158
#endif /* _KERNEL */
155
159
156
#endif /* !_SYS_BIO_H_ */
160
#endif /* !_SYS_BIO_H_ */
(-)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