From owner-svn-src-stable-9@FreeBSD.ORG Wed Nov 5 23:57:34 2014 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5E3726C0; Wed, 5 Nov 2014 23:57:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2FBC0CB3; Wed, 5 Nov 2014 23:57:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA5NvYCN072816; Wed, 5 Nov 2014 23:57:34 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA5NvYjw072815; Wed, 5 Nov 2014 23:57:34 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201411052357.sA5NvYjw072815@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Wed, 5 Nov 2014 23:57:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r274152 - stable/9/sys/fs/nfsclient X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Nov 2014 23:57:34 -0000 Author: rmacklem Date: Wed Nov 5 23:57:33 2014 New Revision: 274152 URL: https://svnweb.freebsd.org/changeset/base/274152 Log: MFC: r273486 Clip the settings for the NFS rsize, wsize mount options to a power of 2. For non-power of 2 settings, intermittent page faults have been reported. Although the bug that causes these page faults/crashes has not been identified, it does not appear to occur when rsize, wsize is a power of 2. Modified: stable/9/sys/fs/nfsclient/nfs_clvfsops.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/fs/ (props changed) Modified: stable/9/sys/fs/nfsclient/nfs_clvfsops.c ============================================================================== --- stable/9/sys/fs/nfsclient/nfs_clvfsops.c Wed Nov 5 23:54:33 2014 (r274151) +++ stable/9/sys/fs/nfsclient/nfs_clvfsops.c Wed Nov 5 23:57:33 2014 (r274152) @@ -615,17 +615,27 @@ nfs_decode_args(struct mount *mp, struct if ((argp->flags & NFSMNT_WSIZE) && argp->wsize > 0) { nmp->nm_wsize = argp->wsize; - /* Round down to multiple of blocksize */ - nmp->nm_wsize &= ~(NFS_FABLKSIZE - 1); - if (nmp->nm_wsize <= 0) + /* + * Clip at the power of 2 below the size. There is an + * issue (not isolated) that causes intermittent page + * faults if this is not done. + */ + if (nmp->nm_wsize > NFS_FABLKSIZE) + nmp->nm_wsize = 1 << (fls(nmp->nm_wsize) - 1); + else nmp->nm_wsize = NFS_FABLKSIZE; } if ((argp->flags & NFSMNT_RSIZE) && argp->rsize > 0) { nmp->nm_rsize = argp->rsize; - /* Round down to multiple of blocksize */ - nmp->nm_rsize &= ~(NFS_FABLKSIZE - 1); - if (nmp->nm_rsize <= 0) + /* + * Clip at the power of 2 below the size. There is an + * issue (not isolated) that causes intermittent page + * faults if this is not done. + */ + if (nmp->nm_rsize > NFS_FABLKSIZE) + nmp->nm_rsize = 1 << (fls(nmp->nm_rsize) - 1); + else nmp->nm_rsize = NFS_FABLKSIZE; }