public inbox for linux-nfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Bruce Fields <bfields@fieldses.org>
To: Chuck Lever <chuck.lever@oracle.com>
Cc: Linux NFS Mailing List <linux-nfs@vger.kernel.org>
Subject: Re: still seeing single client NFS4ERR_DELAY / CB_RECALL
Date: Sun, 9 Aug 2020 17:25:31 -0400	[thread overview]
Message-ID: <20200809212531.GB29574@fieldses.org> (raw)
In-Reply-To: <20200809202739.GA29574@fieldses.org>

On Sun, Aug 09, 2020 at 04:27:39PM -0400, Bruce Fields wrote:
> On Sun, Aug 09, 2020 at 01:11:36PM -0400, Chuck Lever wrote:
> > Hi Bruce-
> > 
> > I noticed that one of my tests takes about 4x longer on NFSv4.0 than
> > it does on NFSv3 or NFSv4.[12]. As an initial stab at the cause, I'm
> > seeing lots of these:
> 
> Oops, looks obvious in retrospect, but I didn't think of it.
> 
> In the 4.1+ case, sessions mean that we know which client every
> operation comes from.
> 
> In the 4.0 case that only works for operations that take a stateid or
> something else we can link back to a client.
> 
> That means in the 4.0 case delegations are less useful, since they have
> to be broken on any (non-truncating) setattr, any link/unlink, etc.,
> even if the operation comes from the same client--the server doesn't
> have a way to know that.
> 
> Maybe the change to give out read delegations even on write opens
> probably just isn't worth in the 4.0 case.

Untested, but maybe this?--b.

commit 2102ac0b68f3
Author: J. Bruce Fields <bfields@redhat.com>
Date:   Sun Aug 9 17:11:59 2020 -0400

    nfsd4: don't grant delegations on 4.0 create opens
    
    Chuck reported a major slowdown running the git regression suite over
    NFSv4.0.
    
    In the 4.0 case, the server has no way to identify which client most
    metadata-modifying operations come from.  So, for example, the common
    pattern of a a setattr is likely to result in an immediate break in the
    4.0 case.
    
    It's probably not worth giving out delegations on 4.0 creates.
    
    Reported-by: Chuck Lever <chuck.lever@oracle.com>
    Signed-off-by: J. Bruce Fields <bfields@redhat.com>

diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index fdba971d06c3..ce2d052b3f64 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -5096,6 +5096,16 @@ nfs4_open_delegation(struct svc_fh *fh, struct nfsd4_open *open,
 				goto out_no_deleg;
 			if (!cb_up || !(oo->oo_flags & NFS4_OO_CONFIRMED))
 				goto out_no_deleg;
+			/*
+			 * In the absence of sessions, most operations
+			 * that modify metadata (like setattr) can't
+			 * be linked to the client sending them, so
+			 * will result in a delegation break.  That's
+			 * especially likely for create opens:
+			 */
+			if (clp->cl_minorversion == 0 &&
+					open->op_create == NFS4_OPEN_CREATE)
+				goto out_no_deleg;
 			break;
 		default:
 			goto out_no_deleg;

  reply	other threads:[~2020-08-09 21:25 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-09 17:11 still seeing single client NFS4ERR_DELAY / CB_RECALL Chuck Lever
2020-08-09 20:27 ` Bruce Fields
2020-08-09 21:25   ` Bruce Fields [this message]
2020-08-10 18:21     ` Chuck Lever
2020-08-10 19:07       ` Bruce Fields
2020-08-10 20:01         ` Chuck Lever
2020-08-10 20:10           ` Bruce Fields
2020-08-11 13:31             ` Chuck Lever
2020-08-16 20:46               ` Chuck Lever
2020-08-17 22:20                 ` Bruce Fields
2020-08-18 15:27                   ` Chuck Lever
2020-08-18 21:26                   ` Chuck Lever
2020-08-18 21:49                     ` Bruce Fields
2020-08-19 13:26                       ` Chuck Lever
2020-08-19 21:29                     ` Bruce Fields
2020-08-20 12:56                       ` Chuck Lever
2020-08-24 13:39                       ` Chuck Lever
2020-08-24 14:22                         ` Bruce Fields
2020-08-24 15:42                           ` Chuck Lever
2020-09-04 22:01                             ` Bruce Fields
2020-09-04 22:27                               ` 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=20200809212531.GB29574@fieldses.org \
    --to=bfields@fieldses.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox