From patchwork Mon Jan 8 15:18:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Van Hensbergen X-Patchwork-Id: 186043 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:37c1:b0:101:2151:f287 with SMTP id y1csp1087232dyq; Mon, 8 Jan 2024 07:22:53 -0800 (PST) X-Google-Smtp-Source: AGHT+IE5cPVpnPlqxlTY+uJIRCd45BPzOrRl05tXEZLL2ZYm7B41jY52pBUcnauks3mDm9HmhtGB X-Received: by 2002:a17:90a:c78b:b0:28c:9781:d91c with SMTP id gn11-20020a17090ac78b00b0028c9781d91cmr1103447pjb.62.1704727373296; Mon, 08 Jan 2024 07:22:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704727373; cv=none; d=google.com; s=arc-20160816; b=AoYD6Jr7ARMk1SZQ0v9qcyqpBkPEz960qGdUt0cJFB50DUmC5QezmfgXvkQJRnPs0D Z5pu3CE2pLaoX/+xDQIXzPjBhmN/VHV0wprI0ZCTuK7yyYPTrdddr7YcbH02OOyfo4fX wxXdhLmkE+iXWQLn8GZ/MDcXzkRZfBWQwpSiwr+RBlwSWDHzt9JwEK2Ak24KN3Ie3kVT MTYRkZqatTzCc8dkeN3KQ0WFMfRbT7rC4jAU8Ezrc3mraJTeBcV4RA4xhLy7L6wId7zi 87JGP0iM1TNXb2Mgc0elzaLYTCb8Th5o/J5fnxTphbN6+0bkEkZOXnIDloAtAJgEboHe oGIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=aAp8JzQ/iXJQ9THNQbEuCBnObc0SbaPvIRg+91A+vNU=; fh=34zNr7a0BVYUu9GLC6Z8rO/FcAceqP5NONmRFRP2POA=; b=FU4o6+WdUM3gTz1SzvVdRiC0rbLBJ/cVCZi8WwxLlWQlOBC3uvQBWgBgu0KcnPQc9X urJfTpGn3z084DVnOeKADjcvAENifrT3+tuA9gsnDgssub/vGUzUuOeH0dPGs7Ad9aZ2 BwXJZx0mktrx9Afrse1CWJOEjosotbOAaddZnrEfPkFyoI6ktXTwTj2AoFMfIhB1SpyV dykwnxjzOkTHo5Ote5hBNDfh3cyR/Z0mnv7FfoDVnY5J9fnYepxqVDUfp3cNY+K6I1ub GuYHRLkAPhOUpJuts8I0iZAUJwGmNkTYOUdZYxazsfeGvwSM5Y/zgrRd4gqHRoG4Qdzh 3qXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=G8W5ldSG; spf=pass (google.com: domain of linux-kernel+bounces-19754-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-19754-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id q7-20020a17090a9f4700b0028ca417b2fdsi55846pjv.106.2024.01.08.07.22.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Jan 2024 07:22:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-19754-ouuuleilei=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=G8W5ldSG; spf=pass (google.com: domain of linux-kernel+bounces-19754-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-19754-ouuuleilei=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 4B770B23047 for ; Mon, 8 Jan 2024 15:20:43 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6182F53E1F; Mon, 8 Jan 2024 15:18:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="G8W5ldSG" X-Original-To: linux-kernel@vger.kernel.org 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 C6911537FF; Mon, 8 Jan 2024 15:18:35 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B5AD5C433CB; Mon, 8 Jan 2024 15:18:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1704727115; bh=JAXtta6eBaQuUW49iLcF5j0hoJdzALXBq37p3uzPtxo=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=G8W5ldSGTcXe1wI85QiNk/R4Nt5M91jkwxAgBe7JJWfQVHEnkgQGFTbv6dOrakM5w gc9ZTQ75jGGpTENuwGqaq7ouk57FJdGulSMQHIBlQwpo1CSQmQDvlkyVT5WqMesilS k3SuOPvJNU7DOgq8jXIxtfQYV/XYoZ1/d4dRLvLhReGCi3M+OKBfdC3wlgJF+quFi3 L/86jSQk+SAMPcRpB82COCFopTbp/0SrP6l2Dbn+FCUcdI6n9ReBoE7c3eDGnIGCQf YpLNhI9nUhjrENtUo5gQo7W0CT+ug7ZUwKnY3F1InrYA8ZVYUzMp7gQXpiRn99cCOZ pO66HJ+wrohgw== From: Eric Van Hensbergen Date: Mon, 08 Jan 2024 15:18:24 +0000 Subject: [PATCH v2 8/8] fs/9p: fix dups even in uncached mode Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240108-ericvh-fix-cache-dups-v2-8-a73f8822838c@kernel.org> References: <20240108-ericvh-fix-cache-dups-v2-0-a73f8822838c@kernel.org> In-Reply-To: <20240108-ericvh-fix-cache-dups-v2-0-a73f8822838c@kernel.org> To: Latchesar Ionkov , Dominique Martinet , Christian Schoenebeck Cc: v9fs@lists.linux.dev, linux-kernel@vger.kernel.org, Eric Van Hensbergen X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=1475; i=ericvh@kernel.org; h=from:subject:message-id; bh=JAXtta6eBaQuUW49iLcF5j0hoJdzALXBq37p3uzPtxo=; b=owEBbQKS/ZANAwAKAYj/1ftKX/+YAcsmYgBlnBJDMKN7uTDozbiBwYw6Uw+238ExMxgmeCOXH MVtGpdR1/6JAjMEAAEKAB0WIQSWlvDRlqWQmKTK0VGI/9X7Sl//mAUCZZwSQwAKCRCI/9X7Sl// mAAnEACF+V9GYs3urXSoT14H4gdEtiV8xD2pN2kphsn7+ltgzvWpkOPglthv7i2EcrX6IFLUaMY BqITnL8z0RjKO8FY5MFcoUiz+5ROo2gr63Me1HOYmJb4H+lH5Xj/XmBGTltdtZpblJhcpAD7xI6 mQxAB85VQp7jzbCO7Vj5Aamf/SlIyD/CI6yYh0IRI7XBJG2b7AzjeUP2iKWXAHqnnX4KTiOptHn I/adoxCTrkL5wJixuFYBGRLNGWlHBrkntkGse65utIbuHOGKADPU+u0kxnw6FUGE/vjIMQt0vdF fk45nf4YHmvvyxYcuvgN11ua4e38hJs8dfKMRNOlBNEZ21Ck/87LtT/6mZNZzZWt5U+DLOsNPGH V7zB8BExdew9hrai/DkW6QBkPIBo8YLBBOShuLskj52H8XLT/D1YX0gAImgvDtMOcG7TvAQbthS OXTfa+040u8xfVK7TpGCwbsGw4uhNGe/oaLZr8HFbHGrNXziiUUBeLrVaHp2a13wcS1sBqZ8jI6 Fzm3S29DkK8OLmZA8kSbqXAGEN/+7UbZnLpbIlMNvIzbjtZhKjLUAmFYtpaTTySBjZ01oRjTaiw ga1EE8R+v46LgJLD43Ri9p+yqld9tIgHY036w+1Xh4EsKk/XRiyg7QIvguTMfz1M0a7nanGP5O2 rfsuDmgHuskwUiQ== X-Developer-Key: i=ericvh@kernel.org; a=openpgp; fpr=9696F0D196A59098A4CAD15188FFD5FB4A5FFF98 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1787536209934377127 X-GMAIL-MSGID: 1787536209934377127 In uncached mode we were still seeing duplicate getattr requests because of aggressive dropping of inodes. Inode "freshness" is guarded by other mechanisms when caches are disabled so this is unnecessary and increases overhead of almost every operation. Signed-off-by: Eric Van Hensbergen --- fs/9p/vfs_super.c | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/fs/9p/vfs_super.c b/fs/9p/vfs_super.c index 6d9a98c57185..a898dbf97710 100644 --- a/fs/9p/vfs_super.c +++ b/fs/9p/vfs_super.c @@ -244,21 +244,6 @@ static int v9fs_statfs(struct dentry *dentry, struct kstatfs *buf) return res; } -static int v9fs_drop_inode(struct inode *inode) -{ - struct v9fs_session_info *v9ses; - - v9ses = v9fs_inode2v9ses(inode); - if (v9ses->cache & (CACHE_META|CACHE_LOOSE)) - return generic_drop_inode(inode); - /* - * in case of non cached mode always drop the - * inode because we want the inode attribute - * to always match that on the server. - */ - return 1; -} - static int v9fs_write_inode(struct inode *inode, struct writeback_control *wbc) { @@ -303,7 +288,6 @@ static const struct super_operations v9fs_super_ops_dotl = { .alloc_inode = v9fs_alloc_inode, .free_inode = v9fs_free_inode, .statfs = v9fs_statfs, - .drop_inode = v9fs_drop_inode, .evict_inode = v9fs_evict_inode, .show_options = v9fs_show_options, .umount_begin = v9fs_umount_begin,