All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bruce Fields <bfields@fieldses.org>
To: Chuck Lever <chuck.lever@oracle.com>
Cc: Bill Baker <Bill.Baker@oracle.com>,
	Linux NFS Mailing List <linux-nfs@vger.kernel.org>
Subject: Re: [PATCH v2 26/27] NFSD: Add tracepoints in the NFS dispatcher
Date: Fri, 25 Sep 2020 10:17:16 -0400	[thread overview]
Message-ID: <20200925141716.GC1096@fieldses.org> (raw)
In-Reply-To: <801F3A94-4668-4DF6-9CAF-27171EEBA17A@oracle.com>

On Fri, Sep 25, 2020 at 09:59:54AM -0400, Chuck Lever wrote:
> 
> 
> > On Sep 24, 2020, at 7:45 PM, J. Bruce Fields <bfields@fieldses.org> wrote:
> > 
> > On Mon, Sep 21, 2020 at 02:13:07PM -0400, Chuck Lever wrote:
> >> This is follow-on work to the tracepoints added in the NFS server's
> >> duplicate reply cache. Here, tracepoints are introduced that report
> >> replies from cache as well as encoding and decoding errors.
> >> 
> >> The NFSv2, v3, and v4 dispatcher requirements have diverged over
> >> time, leaving us with a little bit of technical debt. In addition,
> >> I wanted to add a tracepoint for NFSv2 and NFSv3 similar to the
> >> nfsd4_compound/compoundstatus tracepoints. Lastly, removing some
> >> conditional branches from this hot path helps optimize CPU
> >> utilization. So, I've duplicated the nfsd_dispatcher function.
> > 
> > Comparing current nfsd_dispatch to the nfsv2/v3 nfsd_dispatch: the only
> > thing I spotted removed from the v2/v3-specific dispatch is the
> > rq_lease_breaker = NULL.  (I think that's not correct, actually.  We
> > could remove the need for that to be set in the v2/v3 case, but with the
> > current code it does need to be set.)
> 
> Noted with thanks.

Maybe just do this?

--b.

commit c7265a111269
Author: J. Bruce Fields <bfields@redhat.com>
Date:   Fri Sep 25 10:12:39 2020 -0400

    nfsd: rq_lease_breaker cleanup
    
    Since only the v4 code cares about it, maybe it's better to leave
    rq_lease_breaker out of the common dispatch code?
    
    Signed-off-by: J. Bruce Fields <bfields@redhat.com>

diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index 62afcae18e17..a498278ba96b 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -4597,6 +4597,9 @@ static bool nfsd_breaker_owns_lease(struct file_lock *fl)
 
 	if (!i_am_nfsd())
 		return NULL;
+	/* Note rq_prog == NFS_ACL_PROGRAM is also possible: */
+	if (rqst->rq_prog != NFS_PROGRAM || rqst->rq_vers < 4)
+		return NULL;
 	rqst = kthread_data(current);
 	clp = *(rqst->rq_lease_breaker);
 	return dl->dl_stid.sc_client == clp;
diff --git a/fs/nfsd/nfssvc.c b/fs/nfsd/nfssvc.c
index b603dfcdd361..8d6f6f4c8b28 100644
--- a/fs/nfsd/nfssvc.c
+++ b/fs/nfsd/nfssvc.c
@@ -1016,7 +1016,6 @@ nfsd_dispatch(struct svc_rqst *rqstp, __be32 *statp)
 		*statp = rpc_garbage_args;
 		return 1;
 	}
-	rqstp->rq_lease_breaker = NULL;
 	/*
 	 * Give the xdr decoder a chance to change this if it wants
 	 * (necessary in the NFSv4.0 compound case)

  reply	other threads:[~2020-09-25 14:17 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-21 18:10 [PATCH v2 00/27] NFSD operation monitoring tracepoints Chuck Lever
2020-09-21 18:10 ` [PATCH v2 01/27] NFS: Move generic FS show macros to global header Chuck Lever
2020-09-21 18:11 ` [PATCH v2 02/27] NFS: Move NFS protocol display " Chuck Lever
2020-09-21 18:11 ` [PATCH v2 03/27] NFSD: Add SPDX header for fs/nfsd/trace.c Chuck Lever
2020-09-21 18:11 ` [PATCH v2 04/27] SUNRPC: Move the svc_xdr_recvfrom() tracepoint Chuck Lever
2020-09-21 18:11 ` [PATCH v2 05/27] SUNRPC: Add svc_xdr_authenticate tracepoint Chuck Lever
2020-09-21 18:11 ` [PATCH v2 06/27] lockd: Replace PROC() macro with open code Chuck Lever
2020-09-21 18:11 ` [PATCH v2 07/27] NFSACL: " Chuck Lever
2020-09-21 18:11 ` [PATCH v2 08/27] SUNRPC: Make trace_svc_process() display the RPC procedure symbolically Chuck Lever
2020-09-21 18:11 ` [PATCH v2 09/27] NFSD: Clean up the show_nf_may macro Chuck Lever
2020-09-21 18:11 ` [PATCH v2 10/27] NFSD: Remove extra "0x" in tracepoint format specifier Chuck Lever
2020-09-21 18:11 ` [PATCH v2 11/27] NFSD: Constify @fh argument of knfsd_fh_hash() Chuck Lever
2020-09-21 18:11 ` [PATCH v2 12/27] NFSD: Add tracepoint in nfsd_setattr() Chuck Lever
2020-09-21 18:11 ` [PATCH v2 13/27] NFSD: Add tracepoint for nfsd_access() Chuck Lever
2020-09-21 18:12 ` [PATCH v2 14/27] NFSD: nfsd_compound_status tracepoint should record XID Chuck Lever
2020-09-21 18:12 ` [PATCH v2 15/27] NFSD: Add client ID lifetime tracepoints Chuck Lever
2020-09-21 18:12 ` [PATCH v2 16/27] NFSD: Add tracepoints to report NFSv4 session state Chuck Lever
2020-09-21 18:12 ` [PATCH v2 17/27] NFSD: Add a tracepoint to report the current filehandle Chuck Lever
2020-09-21 18:12 ` [PATCH v2 18/27] NFSD: Add GETATTR tracepoint Chuck Lever
2020-09-21 18:12 ` [PATCH v2 19/27] NFSD: Add tracepoint in nfsd4_stateid_preprocess() Chuck Lever
2020-09-21 18:12 ` [PATCH v2 20/27] NFSD: Add tracepoint to report arguments to NFSv4 OPEN Chuck Lever
2020-09-21 18:12 ` [PATCH v2 21/27] NFSD: Add a tracepoint for DELEGRETURN Chuck Lever
2020-09-21 18:12 ` [PATCH v2 22/27] NFSD: Add a lookup tracepoint Chuck Lever
2020-09-21 18:12 ` [PATCH v2 23/27] NFSD: Add lock and locku tracepoints Chuck Lever
2020-09-21 18:12 ` [PATCH v2 24/27] NFSD: Add tracepoints to record the result of TEST_STATEID and FREE_STATEID Chuck Lever
2020-09-21 18:13 ` [PATCH v2 25/27] NFSD: Rename nfsd_ tracepoints to nfsd4_ Chuck Lever
2020-09-21 18:13 ` [PATCH v2 26/27] NFSD: Add tracepoints in the NFS dispatcher Chuck Lever
2020-09-24 23:45   ` J. Bruce Fields
2020-09-25 13:59     ` Chuck Lever
2020-09-25 14:17       ` Bruce Fields [this message]
2020-09-25 14:21         ` Chuck Lever
2020-09-25 14:18       ` Chuck Lever
2020-09-25 14:47       ` Bruce Fields
2020-09-21 18:13 ` [PATCH v2 27/27] NFSD: Replace dprintk callsites in fs/nfsd/nfsfh.c Chuck Lever
2020-09-24 21:36 ` [PATCH v2 00/27] NFSD operation monitoring tracepoints J. Bruce Fields
2020-09-25 13:59   ` Chuck Lever
2020-09-25 14:32     ` Bruce Fields
2020-09-25 14:36       ` Chuck Lever
2020-09-25 15:00         ` Bruce Fields
2020-09-25 15:05           ` Chuck Lever
2020-09-25 17:04             ` Chuck Lever
2020-09-25 18:37               ` Bruce Fields
2020-09-25 18:41                 ` Chuck Lever

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200925141716.GC1096@fieldses.org \
    --to=bfields@fieldses.org \
    --cc=Bill.Baker@oracle.com \
    --cc=chuck.lever@oracle.com \
    --cc=linux-nfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.