Author: kib
Date: Tue Nov 10 08:39:07 2015
New Revision: 290638
URL: https://svnweb.freebsd.org/changeset/base/290638
Log:
MFC r290047:
Do not perform read-ahead for BA_CLRBUF request when we are low on
memory or when dirty buffer queue is too large.
Modified:
stable/10/sys/ufs/ffs/ffs_balloc.c
Directory Properties:
stable/10/ (props changed)
Modified: stable/10/sys/ufs/ffs/ffs_balloc.c
==============================================================================
--- stable/10/sys/ufs/ffs/ffs_balloc.c Tue Nov 10 08:11:27 2015
(r290637)
+++ stable/10/sys/ufs/ffs/ffs_balloc.c Tue Nov 10 08:39:07 2015
(r290638)
@@ -429,7 +429,9 @@ retry:
brelse(bp);
if (flags & BA_CLRBUF) {
int seqcount = (flags & BA_SEQMASK) >> BA_SEQSHIFT;
- if (seqcount && (vp->v_mount->mnt_flag & MNT_NOCLUSTERR) == 0) {
+ if (seqcount != 0 &&
+ (vp->v_mount->mnt_flag & MNT_NOCLUSTERR) == 0 &&
+ !(vm_page_count_severe() || buf_dirty_count_severe())) {
error = cluster_read(vp, ip->i_size, lbn,
(int)fs->fs_bsize, NOCRED,
MAXBSIZE, seqcount, gbflags, &nbp);
@@ -998,7 +1000,9 @@ retry:
*/
if (flags & BA_CLRBUF) {
int seqcount = (flags & BA_SEQMASK) >> BA_SEQSHIFT;
- if (seqcount && (vp->v_mount->mnt_flag & MNT_NOCLUSTERR) == 0) {
+ if (seqcount != 0 &&
+ (vp->v_mount->mnt_flag & MNT_NOCLUSTERR) == 0 &&
+ !(vm_page_count_severe() || buf_dirty_count_severe())) {
error = cluster_read(vp, ip->i_size, lbn,
(int)fs->fs_bsize, NOCRED,
MAXBSIZE, seqcount, gbflags, &nbp);
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"