Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 10 Nov 2015 08:39:07 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r290638 - stable/10/sys/ufs/ffs
Message-ID:  <201511100839.tAA8d7Hk042884@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201511100839.tAA8d7Hk042884>