All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff Layton <jlayton@kernel.org>
To: Trond Myklebust <trond.myklebust@primarydata.com>,
	"J . Bruce Fields" <bfields@fieldses.org>
Cc: linux-nfs@vger.kernel.org
Subject: Re: [PATCH] nfsd: Do not refuse to serve out of cache
Date: Wed, 28 Mar 2018 15:20:45 -0400	[thread overview]
Message-ID: <1522264845.5165.1.camel@kernel.org> (raw)
In-Reply-To: <20180328161801.8360-1-trond.myklebust@primarydata.com>

On Wed, 2018-03-28 at 12:18 -0400, Trond Myklebust wrote:
> Currently the knfsd replay cache appears to try to refuse replying to
> retries that come within 200ms of the cache entry being created. That
> makes limited sense in today's world of high speed TCP.
> 
> Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
> ---
>  fs/nfsd/cache.h    | 5 -----
>  fs/nfsd/nfscache.c | 6 ++----
>  2 files changed, 2 insertions(+), 9 deletions(-)
> 
> diff --git a/fs/nfsd/cache.h b/fs/nfsd/cache.h
> index 046b3f048757..b7559c6f2b97 100644
> --- a/fs/nfsd/cache.h
> +++ b/fs/nfsd/cache.h
> @@ -67,11 +67,6 @@ enum {
>  	RC_REPLBUFF,
>  };
>  
> -/*
> - * If requests are retransmitted within this interval, they're
> dropped.
> - */
> -#define RC_DELAY		(HZ/5)
> -
>  /* Cache entries expire after this time period */
>  #define RC_EXPIRE		(120 * HZ)
>  
> diff --git a/fs/nfsd/nfscache.c b/fs/nfsd/nfscache.c
> index 334f2ad60704..637f87c39183 100644
> --- a/fs/nfsd/nfscache.c
> +++ b/fs/nfsd/nfscache.c
> @@ -394,7 +394,6 @@ nfsd_cache_lookup(struct svc_rqst *rqstp)
>  	__wsum			csum;
>  	u32 hash = nfsd_cache_hash(xid);
>  	struct nfsd_drc_bucket *b = &drc_hashtbl[hash];
> -	unsigned long		age;
>  	int type = rqstp->rq_cachetype;
>  	int rtn = RC_DOIT;
>  
> @@ -461,12 +460,11 @@ nfsd_cache_lookup(struct svc_rqst *rqstp)
>  found_entry:
>  	nfsdstats.rchits++;
>  	/* We found a matching entry which is either in progress or
> done. */
> -	age = jiffies - rp->c_timestamp;
>  	lru_put_end(b, rp);
>  
>  	rtn = RC_DROPIT;
> -	/* Request being processed or excessive rexmits */
> -	if (rp->c_state == RC_INPROG || age < RC_DELAY)
> +	/* Request being processed */
> +	if (rp->c_state == RC_INPROG)
>  		goto out;
>  
>  	/* From the hall of fame of impractical attacks:

That condition always looked a bit suspicious to me.

Acked-by: Jeff Layton <jlayton@kernel.org>

  reply	other threads:[~2018-03-28 19:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-28 16:18 [PATCH] nfsd: Do not refuse to serve out of cache Trond Myklebust
2018-03-28 19:20 ` Jeff Layton [this message]
2018-03-28 20:10   ` J . Bruce Fields

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=1522264845.5165.1.camel@kernel.org \
    --to=jlayton@kernel.org \
    --cc=bfields@fieldses.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=trond.myklebust@primarydata.com \
    /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.