From patchwork Wed Mar 28 16:18:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Trond Myklebust X-Patchwork-Id: 10313545 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C46ED600F6 for ; Wed, 28 Mar 2018 16:18:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B3FB628E6F for ; Wed, 28 Mar 2018 16:18:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A8ADB28FF6; Wed, 28 Mar 2018 16:18:33 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 29F2028E6F for ; Wed, 28 Mar 2018 16:18:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751207AbeC1QSc (ORCPT ); Wed, 28 Mar 2018 12:18:32 -0400 Received: from mail-io0-f194.google.com ([209.85.223.194]:42175 "EHLO mail-io0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751135AbeC1QSb (ORCPT ); Wed, 28 Mar 2018 12:18:31 -0400 Received: by mail-io0-f194.google.com with SMTP id d5so4189300iob.9 for ; Wed, 28 Mar 2018 09:18:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=szIhwGXtelo0o3Gs9rc2Z3HMPDOF5ng7nXhrIrpsUFQ=; b=OXCYTxIWc/g30CQTDDnuR6hwDuit7zPnMM9HocwHOwU7SaoxVmXm3bGNlAk8OysvZB AXtyIBt0R/Wf95TI5GWg/IvkuYbP1TeTq+9JOokkaYbo+IVtSF4LPFepN36LrUylt2kB 2HmD/vLcggrcGErbVw5GDqn2VqVSV4jko2VODCbyXEaS6NYk/i51LI26FFlf8YWGSaoH Bm6fBtLdLU5J093eYx9wxe1QLUQC1A14U5ymth4/GDEICQflu45JwNeBdofQjpgcmuVu VEtZ85F4Fn7A8DihYqXUVNxUtl6+2wD39FxCM0SrtXmDJTiOZXjnaqtAdQoQAvpPgck8 cbCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :mime-version:content-transfer-encoding; bh=szIhwGXtelo0o3Gs9rc2Z3HMPDOF5ng7nXhrIrpsUFQ=; b=aow/74XHdxp+0a75l5hQ66s2VC0E7aslP/phulO8zTyUPhpy8daGKpeZKpe140WoUr Wfk5Gw0MavLm11uSUqcuGKWwvziKYuEv9UJKxghx821AC5VCCy6uQhHnZZlFk3c7MdVv k5655t59wDVDowKAzfgfhD9yRSSqsslvyHkFb/dXGXygv9vvfpAaXXVivJXKM+ftKviq QZ9Viru/qQN+iqoJZbh3z7TJcZw+nCMxLDqqbCaJEGlyXZdkJ2P1nyLArlWsfLIEU5yB usUP+DG7MczqoSRE73MYLPRVtIV+Hb2zWmKSY3ycuOV9r7Di5tsjO4p+L2wHo3ueSTXa jUDA== X-Gm-Message-State: AElRT7GPR7azf7sIXXnPMgR1ETBHbMwNCcbGLGxgBDGepOsWLnRdZDWt XW4CJxAlRH3/by4npej9Yw== X-Google-Smtp-Source: AIpwx49e38rKlcDf8S/m/hz7ZrcAfApGeAn/SIiRrAMQY11NG+TBIW/ymZPzwBY4iqqVAk/2dYYLbA== X-Received: by 10.107.58.213 with SMTP id h204mr17271944ioa.265.1522253910639; Wed, 28 Mar 2018 09:18:30 -0700 (PDT) Received: from leira.trondhjem.org.localdomain (49.sub-174-230-8.myvzw.com. [174.230.8.49]) by smtp.gmail.com with ESMTPSA id b34-v6sm3087176itd.12.2018.03.28.09.18.27 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 28 Mar 2018 09:18:29 -0700 (PDT) From: Trond Myklebust To: "J . Bruce Fields" Cc: linux-nfs@vger.kernel.org Subject: [PATCH] nfsd: Do not refuse to serve out of cache Date: Wed, 28 Mar 2018 12:18:01 -0400 Message-Id: <20180328161801.8360-1-trond.myklebust@primarydata.com> X-Mailer: git-send-email 2.14.3 MIME-Version: 1.0 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Acked-by: Jeff Layton --- 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: