FreeBSD Bugzilla – Attachment 134337 Details for
Bug 178997
[vfs] [patch] Heavy disk I/O may hang system
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
bo_dirty.bv_cnt_FIX_prod.patch
bo_dirty.bv_cnt_FIX_prod.patch (text/x-diff; charset=us-ascii), 1.91 KB, created by
Klaus Weber
on 2013-07-21 18:45:25 UTC
(
hide
)
Description:
bo_dirty.bv_cnt_FIX_prod.patch
Filename:
MIME Type:
Creator:
Klaus Weber
Created:
2013-07-21 18:45:25 UTC
Size:
1.91 KB
patch
obsolete
>Index: sys/kern/vfs_bio.c >=================================================================== >--- sys/kern/vfs_bio.c (revision 253339) >+++ sys/kern/vfs_bio.c (working copy) >@@ -1146,7 +1146,7 @@ > if (bo->bo_dirty.bv_cnt > dirtybufthresh + 10) { > (void) VOP_FSYNC(bp->b_vp, MNT_NOWAIT, curthread); > altbufferflushes++; >- } else if (bo->bo_dirty.bv_cnt > dirtybufthresh) { >+ } else if ( bdflush_required(bo) ) { > BO_LOCK(bo); > /* > * Try to find a buffer to flush. >@@ -1438,6 +1438,28 @@ > } > > /* >+ * Flushing is deemed necessary if at least one of the following is true: >+ * - bo is hogging more than dirtybufthresh buffers (previous behavior) >+ * - numdirtybuffers exceeds dirtybufthresh >+ * - we are or act as bufdaemon (TDP_NORUNNINGBUF) >+ * >+ * Used by bufbdflush (above) and ffs_bdflush (in ffs_snapshot). >+ */ >+int >+bdflush_required(struct bufobj *bo) >+{ >+ struct thread *td = curthread; >+ >+ KASSERT(bo != NULL, ("bdflush_required: NULL bo")); >+ >+ if ((bo->bo_dirty.bv_cnt > dirtybufthresh) || >+ (numdirtybuffers > dirtybufthresh) || >+ (td && (td->td_pflags & TDP_NORUNNINGBUF)) ) >+ return(1); >+ return(0); >+ } >+ >+/* > * brelse: > * > * Release a busy buffer and, if requested, free its resources. The >Index: sys/sys/bio.h >=================================================================== >--- sys/sys/bio.h (revision 253339) >+++ sys/sys/bio.h (working copy) >@@ -151,6 +151,10 @@ > #define physread physio > #define physwrite physio > >+extern struct bufobj *bo; >+int bdflush_required(struct bufobj *bo); >+ >+ > #endif /* _KERNEL */ > > #endif /* !_SYS_BIO_H_ */ >Index: sys/ufs/ffs/ffs_snapshot.c >=================================================================== >--- sys/ufs/ffs/ffs_snapshot.c (revision 253339) >+++ sys/ufs/ffs/ffs_snapshot.c (working copy) >@@ -2161,7 +2161,7 @@ > struct buf *nbp; > int bp_bdskip; > >- if (bo->bo_dirty.bv_cnt <= dirtybufthresh) >+ if ( !bdflush_required(bo) ) > return; > > td = curthread;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 178997
: 134337 |
134338