From owner-svn-src-stable@freebsd.org Fri Feb 2 00:52:30 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E8B0BED8E20; Fri, 2 Feb 2018 00:52:29 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 83EF571A02; Fri, 2 Feb 2018 00:52:29 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7ECA114B59; Fri, 2 Feb 2018 00:52:29 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w120qT3M091950; Fri, 2 Feb 2018 00:52:29 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w120qT1s091949; Fri, 2 Feb 2018 00:52:29 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201802020052.w120qT1s091949@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Fri, 2 Feb 2018 00:52:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r328764 - stable/11/sys/kern X-SVN-Group: stable-11 X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: stable/11/sys/kern X-SVN-Commit-Revision: 328764 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Feb 2018 00:52:30 -0000 Author: mckusick Date: Fri Feb 2 00:52:29 2018 New Revision: 328764 URL: https://svnweb.freebsd.org/changeset/base/328764 Log: MFC of 328444. Eliminate "fsync: giving up on dirty" messages. Modified: stable/11/sys/kern/vfs_default.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/vfs_default.c ============================================================================== --- stable/11/sys/kern/vfs_default.c Fri Feb 2 00:07:38 2018 (r328763) +++ stable/11/sys/kern/vfs_default.c Fri Feb 2 00:52:29 2018 (r328764) @@ -629,13 +629,21 @@ vop_stdfsync(ap) struct thread *a_td; } */ *ap; { - struct vnode *vp = ap->a_vp; - struct buf *bp; + struct vnode *vp; + struct buf *bp, *nbp; struct bufobj *bo; - struct buf *nbp; - int error = 0; - int maxretry = 1000; /* large, arbitrarily chosen */ + struct mount *mp; + int error, maxretry; + error = 0; + maxretry = 10000; /* large, arbitrarily chosen */ + vp = ap->a_vp; + mp = NULL; + if (vp->v_type == VCHR) { + VI_LOCK(vp); + mp = vp->v_rdev->si_mountpt; + VI_UNLOCK(vp); + } bo = &vp->v_bufobj; BO_LOCK(bo); loop1: @@ -678,6 +686,8 @@ loop2: bremfree(bp); bawrite(bp); } + if (maxretry < 1000) + pause("dirty", hz < 1000 ? 1 : hz / 1000); BO_LOCK(bo); goto loop2; } @@ -699,7 +709,8 @@ loop2: TAILQ_FOREACH(bp, &bo->bo_dirty.bv_hd, b_bobufs) if ((error = bp->b_error) == 0) continue; - if (error == 0 && --maxretry >= 0) + if ((mp != NULL && mp->mnt_secondary_writes > 0) || + (error == 0 && --maxretry >= 0)) goto loop1; error = EAGAIN; }