From nobody Sat Nov 13 01:36:37 2021 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id A8EAB1850979; Sat, 13 Nov 2021 01:36:37 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HrdN549mhz3JNf; Sat, 13 Nov 2021 01:36:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7086A2174; Sat, 13 Nov 2021 01:36:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AD1abSq063685; Sat, 13 Nov 2021 01:36:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AD1abYJ063684; Sat, 13 Nov 2021 01:36:37 GMT (envelope-from git) Date: Sat, 13 Nov 2021 01:36:37 GMT Message-Id: <202111130136.1AD1abYJ063684@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Rick Macklem Subject: git: ce9676de86f2 - main - pNFS: Add nfsstats counters for number of Layouts List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ce9676de86f267986f61979151101e3d8a6d61bc Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=ce9676de86f267986f61979151101e3d8a6d61bc commit ce9676de86f267986f61979151101e3d8a6d61bc Author: Rick Macklem AuthorDate: 2021-11-13 01:32:55 +0000 Commit: Rick Macklem CommitDate: 2021-11-13 01:32:55 +0000 pNFS: Add nfsstats counters for number of Layouts For pNFS, Layouts are issued by the server to indicate where a file's data resides on the DS(s). This patch adds counters for how many layouts are allocated to the nfsstatsv1 structure, using two reserved fields. MFC after: 2 weeks --- sys/fs/nfs/nfsport.h | 4 ++-- sys/fs/nfsclient/nfs_clstate.c | 2 ++ sys/fs/nfsserver/nfs_nfsdstate.c | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/sys/fs/nfs/nfsport.h b/sys/fs/nfs/nfsport.h index 5dcce15f7f64..e099cf6e46f0 100644 --- a/sys/fs/nfs/nfsport.h +++ b/sys/fs/nfs/nfsport.h @@ -459,8 +459,8 @@ struct nfsstatsv1 { uint64_t rpccnt[NFSV42_NPROCS + 11]; uint64_t rpcretries; uint64_t srvrpccnt[NFSV42_NOPS + NFSV4OP_FAKENOPS + 15]; - uint64_t reserved_0; - uint64_t reserved_1; + uint64_t srvlayouts; + uint64_t cllayouts; uint64_t rpcrequests; uint64_t rpctimeouts; uint64_t rpcunexpected; diff --git a/sys/fs/nfsclient/nfs_clstate.c b/sys/fs/nfsclient/nfs_clstate.c index 1df8530d0e39..082469aef1bc 100644 --- a/sys/fs/nfsclient/nfs_clstate.c +++ b/sys/fs/nfsclient/nfs_clstate.c @@ -5212,6 +5212,7 @@ nfscl_layout(struct nfsmount *nmp, vnode_t vp, u_int8_t *fhp, int fhlen, nfsly_hash); lyp->nfsly_timestamp = NFSD_MONOSEC + 120; nfscl_layoutcnt++; + nfsstatsv1.cllayouts++; } else { if (retonclose != 0) lyp->nfsly_flags |= NFSLY_RETONCLOSE; @@ -5586,6 +5587,7 @@ nfscl_freelayout(struct nfscllayout *layp) free(rp, M_NFSLAYRECALL); } nfscl_layoutcnt--; + nfsstatsv1.cllayouts--; free(layp, M_NFSLAYOUT); } diff --git a/sys/fs/nfsserver/nfs_nfsdstate.c b/sys/fs/nfsserver/nfs_nfsdstate.c index e6a919093738..e9acacb27cbd 100644 --- a/sys/fs/nfsserver/nfs_nfsdstate.c +++ b/sys/fs/nfsserver/nfs_nfsdstate.c @@ -7400,6 +7400,7 @@ nfsrv_addlayout(struct nfsrv_descript *nd, struct nfslayout **lypp, /* Insert the new layout in the lists. */ *lypp = NULL; atomic_add_int(&nfsrv_layoutcnt, 1); + nfsstatsv1.srvlayouts++; NFSBCOPY(lyp->lay_xdr, layp, lyp->lay_layoutlen); *layoutlenp = lyp->lay_layoutlen; TAILQ_INSERT_HEAD(&lhyp->list, lyp, lay_list); @@ -7492,6 +7493,7 @@ nfsrv_freelayout(struct nfslayouthead *lhp, struct nfslayout *lyp) NFSD_DEBUG(4, "Freelayout=%p\n", lyp); atomic_add_int(&nfsrv_layoutcnt, -1); + nfsstatsv1.srvlayouts--; TAILQ_REMOVE(lhp, lyp, lay_list); free(lyp, M_NFSDSTATE); }