From owner-svn-src-projects@freebsd.org Sun Sep 8 21:43:21 2019 Return-Path: Delivered-To: svn-src-projects@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 382AFE428C for ; Sun, 8 Sep 2019 21:43:21 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46RPtK0hNgz49KV; Sun, 8 Sep 2019 21:43:21 +0000 (UTC) (envelope-from rmacklem@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 EF7FB388E; Sun, 8 Sep 2019 21:43:20 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x88LhKVT075943; Sun, 8 Sep 2019 21:43:20 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x88LhKOp075940; Sun, 8 Sep 2019 21:43:20 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201909082143.x88LhKOp075940@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Sun, 8 Sep 2019 21:43:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r352049 - in projects/nfsv42/sys/fs: nfs nfsclient nfsserver X-SVN-Group: projects X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: in projects/nfsv42/sys/fs: nfs nfsclient nfsserver X-SVN-Commit-Revision: 352049 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Sep 2019 21:43:21 -0000 Author: rmacklem Date: Sun Sep 8 21:43:19 2019 New Revision: 352049 URL: https://svnweb.freebsd.org/changeset/base/352049 Log: Move vfs.nfsd.maxcopyrange to vfs.nfs.maxcopyrange so client can use it as well. This patch makes the NFSv4.2 client use vfs.nfs.maxcopyrange as a limit for the size of a Copy RPC similar to the NFSv4.2 server. This limit is intended to make synchronous Copy operations complete in less than 1 second so that the RPC round trip time remains below 1 second. I plan on implementing asynchronous Copy for the NFSv4.2 server soon, since that is what the Linux client uses for large Copies. Modified: projects/nfsv42/sys/fs/nfs/nfs_commonsubs.c projects/nfsv42/sys/fs/nfsclient/nfs_clrpcops.c projects/nfsv42/sys/fs/nfsserver/nfs_nfsdserv.c Modified: projects/nfsv42/sys/fs/nfs/nfs_commonsubs.c ============================================================================== --- projects/nfsv42/sys/fs/nfs/nfs_commonsubs.c Sun Sep 8 21:37:52 2019 (r352048) +++ projects/nfsv42/sys/fs/nfs/nfs_commonsubs.c Sun Sep 8 21:43:19 2019 (r352049) @@ -90,6 +90,10 @@ int nfsrv_maxpnfsmirror = 1; SYSCTL_INT(_vfs_nfs, OID_AUTO, pnfsmirror, CTLFLAG_RD, &nfsrv_maxpnfsmirror, 0, "Mirror level for pNFS service"); +int nfs_maxcopyrange = 10 * 1024 * 1024; +SYSCTL_INT(_vfs_nfs, OID_AUTO, maxcopyrange, CTLFLAG_RW, + &nfs_maxcopyrange, 0, "Max size of a Copy so RPC times reasonable"); + /* * This array of structures indicates, for V4: * retfh - which of 3 types of calling args are used Modified: projects/nfsv42/sys/fs/nfsclient/nfs_clrpcops.c ============================================================================== --- projects/nfsv42/sys/fs/nfsclient/nfs_clrpcops.c Sun Sep 8 21:37:52 2019 (r352048) +++ projects/nfsv42/sys/fs/nfsclient/nfs_clrpcops.c Sun Sep 8 21:43:19 2019 (r352049) @@ -75,6 +75,7 @@ extern char nfsv4_callbackaddr[INET6_ADDRSTRLEN]; extern int nfscl_debuglevel; extern int nfs_pnfsiothreads; extern u_long sb_max_adj; +extern int nfs_maxcopyrange; NFSCLSTATEMUTEX; int nfstest_outofseq = 0; int nfscl_assumeposixlocks = 1; @@ -8060,6 +8061,8 @@ nfsrpc_copyrpc(vnode_t invp, off_t inoff, vnode_t outv *commitp = NFSWRITE_UNSTABLE; len = *lenp; *lenp = 0; + if (len > nfs_maxcopyrange) + len = nfs_maxcopyrange; NFSCL_REQSTART(nd, NFSPROC_COPY, invp); NFSM_BUILD(tl, uint32_t *, NFSX_UNSIGNED); *tl = txdr_unsigned(NFSV4OP_GETATTR); Modified: projects/nfsv42/sys/fs/nfsserver/nfs_nfsdserv.c ============================================================================== --- projects/nfsv42/sys/fs/nfsserver/nfs_nfsdserv.c Sun Sep 8 21:37:52 2019 (r352048) +++ projects/nfsv42/sys/fs/nfsserver/nfs_nfsdserv.c Sun Sep 8 21:43:19 2019 (r352049) @@ -67,6 +67,7 @@ extern int nfsd_debuglevel; extern u_long sb_max_adj; extern int nfsrv_pnfsatime; extern int nfsrv_maxpnfsmirror; +extern int nfs_maxcopyrange; #endif /* !APPLEKEXT */ static int nfs_async = 0; @@ -76,9 +77,6 @@ SYSCTL_INT(_vfs_nfsd, OID_AUTO, async, CTLFLAG_RW, &nf extern int nfsrv_doflexfile; SYSCTL_INT(_vfs_nfsd, OID_AUTO, default_flexfile, CTLFLAG_RW, &nfsrv_doflexfile, 0, "Make Flex File Layout the default for pNFS"); -static int nfsrv_maxcopyrange = 10 * 1024 * 1024; -SYSCTL_INT(_vfs_nfsd, OID_AUTO, maxcopyrange, CTLFLAG_RW, - &nfsrv_maxcopyrange, 0, "Max size of a Copy so RPC times reasonable"); /* * This list defines the GSS mechanisms supported. @@ -5338,12 +5336,12 @@ nfsrvd_copy_file_range(struct nfsrv_descript *nd, __un } /* - * Do the actual copy to an upper limit of vfs.nfsd.maxcopyrange. + * Do the actual copy to an upper limit of vfs.nfs.maxcopyrange. * This limit is applied to ensure that the RPC replies in a * reasonable time. */ - if (len > nfsrv_maxcopyrange) - xfer = nfsrv_maxcopyrange; + if (len > nfs_maxcopyrange) + xfer = nfs_maxcopyrange; else xfer = len; nd->nd_repstat = vn_copy_file_range(vp, &inoff, tovp, &outoff, &xfer, 0,