Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp4048324ybv; Mon, 10 Feb 2020 11:16:44 -0800 (PST) X-Google-Smtp-Source: APXvYqxy+PPGSjcGY67bdIptoKmlWW/U3Rhi/f9uozqq2Djkir6Ltv1QqNtdEkbW0rj2nBI4bg6Q X-Received: by 2002:a05:6830:612:: with SMTP id w18mr2243300oti.160.1581362204259; Mon, 10 Feb 2020 11:16:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581362204; cv=none; d=google.com; s=arc-20160816; b=vGx66ETpRLBuF+DHaCLXLQXLCZsVVNDB50tn3N8p5EyV77+lwCf8Qq2gL2UF0n61Ie hV8yrVdvSqESpDgugT+sS6i5ystPWMQBacWHUi6DmANdlQ0rZyxZFn4hLphlcJXL8LPq aIEJdg0Nuk/oW3XQETVcn0SS02HfxgmvbJZ3SjWQ2m65uibBSs8TC+I9NEHB9DDGFmvc MHubNaUuVcb/kWjBM66t890cyq7XVm3vvRWVn7M9iiOK7QTPB45v0P0iuxerdzVPV4yy qSCYSgzqmkvHO4qwLKCKGPMv4i0lnCCNTrM3jJ/g88yK/LEZyHnhZIL3odFqOJ9mcPqS O9Lw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=wP5YOVIjUJKkKgcFCczFDbdtOGhanuwuabMb8PE+9gM=; b=fQ6Z8RDtYMcNgrMwFJOoWc/4JW9luV1iZPmFd6HuvpJ69HSPv0bxs6gZv82dTgadFR RilKJWatNSD0cJk7wMkOHsZUIy+ZuEGgOrsMrzJYcs8FRihkewAl8eREAV5Gf+G8vS0F FfUxMwtcFMofTiBDRBKhCJiWGU07IgaKCDSvkuvJFfwpiM6juAVWZugjnSEqIaBI3DAC 6k+btUjuCQ6oPj9DiLm9SKl43B+Kip/6qV/y3CmX8stVQY+ZtqoEJ5TKDMnKUo0LGGlI ZjKKSsVtzaEXBV0m+SWLIg9S5OTqYp87mgIKbptbhrTyn3tg4znPTcrkwb5UlGxevFts cA+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=muYkk6iD; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b10si568884otp.124.2020.02.10.11.16.32; Mon, 10 Feb 2020 11:16:44 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=muYkk6iD; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727592AbgBJTQO (ORCPT + 99 others); Mon, 10 Feb 2020 14:16:14 -0500 Received: from mail-yw1-f68.google.com ([209.85.161.68]:38757 "EHLO mail-yw1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727572AbgBJTQO (ORCPT ); Mon, 10 Feb 2020 14:16:14 -0500 Received: by mail-yw1-f68.google.com with SMTP id 10so3953250ywv.5 for ; Mon, 10 Feb 2020 11:16:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=wP5YOVIjUJKkKgcFCczFDbdtOGhanuwuabMb8PE+9gM=; b=muYkk6iD0s63CwNio7un27SozL0/ereKoBI7rD1jiP1HQI2Euxg4aI8BM1teHumlrc tjmyNewXvffNl2aTlqxyH1ndKvhDHUQj5oQ0PqQ9JerbnxeD2YSbAdj9Jy2QfyoKz6TC gG4wP7sEqA4IkDp0YHEQ9DytWt73RFbxNjXCiaUTwOtbu/QeMovOUYvqYdqKO6X/sbbW o6Jxksm2Ysl2S0o65gjdhi4mwgpOcPNrxZvoQQYDzdbzc60VU4J7VWprGIvi34JQe3te 3ZYNFXWCWAfHU9hbIWrPVvo6qG9WBU4qfGq29LwfSGDzjiiaA1g8IFeU6gQDlTrpBKFA uDKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=wP5YOVIjUJKkKgcFCczFDbdtOGhanuwuabMb8PE+9gM=; b=dAszKNEK/MIfp1uOvvl0p68IrlVWhXXzM3RbduJ7mfGPHZHfOBY+pMW+Qy8YXXTS2J qw/thKVF221zfhDLd10FRAK18wCxRpIwdMckqiClyn41ZFuWZ566W90afRUqBpfWGyUm EGXmBMsiHmu7j6xu8KheKewFcKG4Z4Cbevm2ekGWEUhT/IWUGlxIzkaOlu8yYiY5lffk fgZ7x7aq37tf5drBLNSRYlht0P0gUWaLNCObm40ehAUwl2a6ddHAN7nzIl4Sel+rEev0 t1P1xjHsWkDi/bQwbO1U3NON/iABXltdQ/nK/7Ch33wlHLWW2lXDIjbRq41vvL9bXBDp d7FQ== X-Gm-Message-State: APjAAAXrh606ij7DQU6usZVkuD46j8MJtSG9P1OKgTS2w8EWcT5iw/4F SwHs0jlsBJWxmz+pfqS4KwyX1x2O4Q== X-Received: by 2002:a81:52d6:: with SMTP id g205mr2310010ywb.179.1581362171942; Mon, 10 Feb 2020 11:16:11 -0800 (PST) Received: from localhost.localdomain (c-68-40-189-247.hsd1.mi.comcast.net. [68.40.189.247]) by smtp.gmail.com with ESMTPSA id o4sm660222ywd.5.2020.02.10.11.16.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Feb 2020 11:16:11 -0800 (PST) From: Trond Myklebust X-Google-Original-From: Trond Myklebust To: linux-nfs@vger.kernel.org Subject: [PATCH 8/8] NFS: Limit the size of the access cache by default Date: Mon, 10 Feb 2020 14:13:45 -0500 Message-Id: <20200210191345.557460-9-trond.myklebust@hammerspace.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200210191345.557460-8-trond.myklebust@hammerspace.com> References: <20200210191345.557460-1-trond.myklebust@hammerspace.com> <20200210191345.557460-2-trond.myklebust@hammerspace.com> <20200210191345.557460-3-trond.myklebust@hammerspace.com> <20200210191345.557460-4-trond.myklebust@hammerspace.com> <20200210191345.557460-5-trond.myklebust@hammerspace.com> <20200210191345.557460-6-trond.myklebust@hammerspace.com> <20200210191345.557460-7-trond.myklebust@hammerspace.com> <20200210191345.557460-8-trond.myklebust@hammerspace.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org Currently, we have no real limit on the access cache size (we set it to ULONG_MAX). That can lead to credentials getting pinned for a very long time on lots of files if you have a system with a lot of memory. Signed-off-by: Trond Myklebust --- fs/nfs/dir.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c index 09bcbdc67135..133bf23430e8 100644 --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c @@ -2307,7 +2307,7 @@ static DEFINE_SPINLOCK(nfs_access_lru_lock); static LIST_HEAD(nfs_access_lru_list); static atomic_long_t nfs_access_nr_entries; -static unsigned long nfs_access_max_cachesize = ULONG_MAX; +static unsigned long nfs_access_max_cachesize = 4*1024*1024; module_param(nfs_access_max_cachesize, ulong, 0644); MODULE_PARM_DESC(nfs_access_max_cachesize, "NFS access maximum total cache length"); -- 2.24.1