Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2565808lqp; Mon, 25 Mar 2024 02:49:43 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX1Pzdp5XuC6qPbseuhS4G22YEZH/Nbwot/NM2rdsLOWDM1NNPGPYS6uLd94JHYS2D72TNizeJ18x8jw6lOFYQG+A4cRPviWLnAJEbLeQ== X-Google-Smtp-Source: AGHT+IGHbnbrJna5fGCLWA0h+Vn2bkRt8Y2ZND558lDF/ADfAM01qybo0N7GNyBtaYwGpTnNPePS X-Received: by 2002:a05:6e02:10d4:b0:368:9974:ffcd with SMTP id s20-20020a056e0210d400b003689974ffcdmr150689ilj.30.1711360183546; Mon, 25 Mar 2024 02:49:43 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711360183; cv=pass; d=google.com; s=arc-20160816; b=Vq+HqLsesiVveh5YI0cV1L8/VgmntiZ0Nc89x0CShLCsaAFWKIV9uM259pohpmXXrU 6ynkq8uNOtl4GoEu4Gvz0nbjATsfw9h7T0hppviDSM3BHSaAEbUHuzqMx30AavZVzR2P F8RUEnpJGW2pwjY3zy3bsn+y3Jkrg62EgOXHALIPOWP9I606n4VdjsiMENK7ZrlMNV7+ PFshwYsWWKb8WUQ7N+TWhbfot2CJcat1pFjEsq+fqlxm5G15gmnDIRgBDib6A7U6YaVl iIhT4QSYs5VNWtwSXbKtdhiFC81nzJcNo6hkdGUzbU7VRCXQwiUcgQx16PAXjXKKDNC2 XMWw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=TTWDCQnr4M1Dx15YZxZlbwid5UUglDlt4JTlFIMfUmA=; fh=eP83VwY2imqUkKC335Vf+S1zDQ2JKOagjMIogzy87iQ=; b=UXtK2mHMspORcGWntLVcTbo4BPmEiGQJOUB3jc4BbgInzBefKaIKzwQvnQyVqayzBq KY//Mo29HKRKIBTPIckDG9YqMNGojzwZc9haGHjJ01PFGok1LZdhXncToKPfnGswem2S qeCOKJzgQ65t1efwvwZULZ374NKKMeBijNoeWFxeZo4Tirrep5uKpKHTVFdYUSIHhqK+ QGetRDwDDOtqGgR9hCZggrvAmiYWlCjLRbm4+9iBy3Vye41o1J9tfNFmS6dTkgVmHXCo TfNVv+t9YklEkhsW16hhgHiKFyJhz6iBfj2OC+mo8y35ejBM9aDLWujAC62UkMOYC7w4 607w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=cCYirlPm; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-115751-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-115751-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id o23-20020a656157000000b005dccf9afad5si7529167pgv.305.2024.03.25.02.49.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Mar 2024 02:49:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-115751-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=cCYirlPm; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-115751-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-115751-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 0BA9CB2ED85 for ; Mon, 25 Mar 2024 09:15:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7D801163A86; Mon, 25 Mar 2024 02:59:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="cCYirlPm" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 73C1E2251E5; Sun, 24 Mar 2024 23:12:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711321936; cv=none; b=KvxYz/vsY1bmPfuxa6rb0WAicW1VeYf30/fX1ZU99Yd70lBxdzHcPAoMb9tKQO5ANz6m0+AgszXuqMI8KlsjO6IHVU/LsfLNa65H8vBSEv4Dzdsncq3v4mhNtfbcMQEpl73sAtM4hAUEVHlYKBugPr3Qadt5WXDMt7LIuzCxLO0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711321936; c=relaxed/simple; bh=dtNOvme6ogz8oy0RlFfXP0mN36Z6AcIzo+gAkw5HKh0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=WgCp+r7nNv2ewuDIoCFcby4RvBZRhMtSwCcfeFyDHK42hpADJff+gCvuPq01JhBxeKbq3WpeaJQ1QUhcYzykyVizLIQ8utMZpAlLY4gPApRz8CInf4eNSmZST2b5wzdUj8HDU24Z8blyx1vcaMXsicP8l+50L6i9AtdgArxe2UM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=cCYirlPm; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id A4CA6C433C7; Sun, 24 Mar 2024 23:12:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711321936; bh=dtNOvme6ogz8oy0RlFfXP0mN36Z6AcIzo+gAkw5HKh0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cCYirlPmgSQKS3WrK5nIHEc00sgJeCD5DUCUvqF7WwN1ZWyHiQBBk38OUrZoIIdLd wsBICc31aFkd8xhpZhhTC33sAkrm4LFvbJ9WKY1YWc2ArP79O/vqQj4G75KIDbZdF9 OMTXOq+Fbh7s4Gtq6rhXnbXFMaZqcnL66ads7Tpihu4S+XV/vX81af0txUuw0rNuVI 3YXVkBu74jwYJM4+I+9KyMhb6pLWwTqsxwlF6HChMyZdlM0atjiLiQvCwwdu/n8n25 cyEES3U30F4VOVpCZu2jHXO4NZqcjrtHbYbyVY3BW59nQ0+nkHP+R4XBLAiyIXPjx9 F4f2sN8mLKoZQ== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Jeff Layton , Chuck Lever , Sasha Levin Subject: [PATCH 6.1 007/451] nfsd: NFSD_FILE_KEY_INODE only needs to find GC'ed entries Date: Sun, 24 Mar 2024 19:04:43 -0400 Message-ID: <20240324231207.1351418-8-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240324231207.1351418-1-sashal@kernel.org> References: <20240324231207.1351418-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit From: Jeff Layton [ Upstream commit 6c31e4c98853a4ba47355ea151b36a77c42b7734 ] Since v4 files are expected to be long-lived, there's little value in closing them out of the cache when there is conflicting access. Change the comparator to also match the gc value in the key. Change both of the current users of that key to set the gc value in the key to "true". Signed-off-by: Jeff Layton Signed-off-by: Chuck Lever Signed-off-by: Sasha Levin --- fs/nfsd/filecache.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/fs/nfsd/filecache.c b/fs/nfsd/filecache.c index 5b5d39ec7b010..c36e3032d4386 100644 --- a/fs/nfsd/filecache.c +++ b/fs/nfsd/filecache.c @@ -175,6 +175,8 @@ static int nfsd_file_obj_cmpfn(struct rhashtable_compare_arg *arg, switch (key->type) { case NFSD_FILE_KEY_INODE: + if (test_bit(NFSD_FILE_GC, &nf->nf_flags) != key->gc) + return 1; if (nf->nf_inode != key->inode) return 1; break; @@ -695,6 +697,7 @@ nfsd_file_queue_for_close(struct inode *inode, struct list_head *dispose) struct nfsd_file_lookup_key key = { .type = NFSD_FILE_KEY_INODE, .inode = inode, + .gc = true, }; struct nfsd_file *nf; @@ -1049,6 +1052,7 @@ nfsd_file_is_cached(struct inode *inode) struct nfsd_file_lookup_key key = { .type = NFSD_FILE_KEY_INODE, .inode = inode, + .gc = true, }; bool ret = false; -- 2.43.0