Message ID | 20230713-mgctime-v5-0-9eb795d2ae37@kernel.org (mailing list archive) |
---|---|
Headers | show
Return-Path: <owner-linux-mm@kvack.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id A0A1EC001DF for <linux-mm@archiver.kernel.org>; Thu, 13 Jul 2023 23:01:14 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C3E7D6B0078; Thu, 13 Jul 2023 19:01:13 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id BEE5E6B007B; Thu, 13 Jul 2023 19:01:13 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A8F0A8D0002; Thu, 13 Jul 2023 19:01:13 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 998B46B0078 for <linux-mm@kvack.org>; Thu, 13 Jul 2023 19:01:13 -0400 (EDT) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 6138EB06A5 for <linux-mm@kvack.org>; Thu, 13 Jul 2023 23:01:13 +0000 (UTC) X-FDA: 81008111226.05.29CD8EF Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf18.hostedemail.com (Postfix) with ESMTP id 6DD231C002B for <linux-mm@kvack.org>; Thu, 13 Jul 2023 23:01:11 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=j9LDsK+F; spf=pass (imf18.hostedemail.com: domain of jlayton@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=jlayton@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1689289271; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:in-reply-to: references:dkim-signature; bh=Mp43JgxFMavcDpp982uzj4L+I7wLpwe01U1XK49Y9lc=; b=459sZ87qy1Ifn5dQBHinVUL6EzVRSqGj2rCAOv0zDsKXSIdsrbTx0jo/oD6qmBYevtluR3 TxiJzGwKWCH31MyePigZgikVBRDUECaQzf8wmIDpQqZ+qZaEW7Z5jzK3DwrFlc/xgxRrDF pnlj1F+aA8WoH1pfYk9GzZ9WsApyKPg= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=j9LDsK+F; spf=pass (imf18.hostedemail.com: domain of jlayton@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=jlayton@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1689289271; a=rsa-sha256; cv=none; b=O8vLcn03QHBDvt5pxnJKkkpmp2PYN1Z1VauTKxFJCZ6ddTK3/yz3+/J4ZG7w195x+1/ybG 27zr3GzynIvwMgXBdoftVxY1DkIHmJ0q8dYL09A6mNISzYskm8kMEffQjjdeaCytH/Zolr roqV1MPg67tKs9Tn6M8h3qyQCWZIRwA= Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id F065061AC4; Thu, 13 Jul 2023 23:01:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 61080C433C8; Thu, 13 Jul 2023 23:01:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1689289269; bh=BvE/6xVatY3gzbwR0vDrqr3MzJ01oINoYu0cSNelaB8=; h=From:Subject:Date:To:Cc:From; b=j9LDsK+FDIrm6x6MxYyXms5zVTjaW1P6LxjzfQKg1pbSvAHLTtuNDrEBEAvQz7a59 IEj5BzbSPgpyeqfAqbd+Re3r0d6jbIHKhpnRq3qprdKRfzdD9X103cXf3qX6JZft6A 8K/RH8+CdgTcLHSepEL1YlNk2ZQmp4oagzqZSvVyVEd/d4TvlnBEIAX/8mUMo/DIpV 2h3UVlHoa/Q76fgIu2dVBLs3sOHMs2qunAcM77C5kvmuuB2TAhiX7+yoiPjn4EbiL6 oufcrYQQLmAklyR8BnHSjocZBlFXqdC5grfG/sCfx8gif0JU3ybUeAnX6i/lTGUMEc tKVmtuCgMrfHw== From: Jeff Layton <jlayton@kernel.org> Subject: [PATCH v5 0/8] fs: implement multigrain timestamps Date: Thu, 13 Jul 2023 19:00:49 -0400 Message-Id: <20230713-mgctime-v5-0-9eb795d2ae37@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-B4-Tracking: v=1; b=H4sIACGCsGQC/6tWKk4tykwtVrJSqFYqSi3LLM7MzwNyTHUUlJIzE vPSU3UzU4B8JSMDI2MDc0Nj3dz05JLM3FTdNKNEy7RkYyMTS0MLJaDqgqLUtMwKsEnRsbW1AO6 XW1JZAAAA To: Eric Van Hensbergen <ericvh@kernel.org>, Latchesar Ionkov <lucho@ionkov.net>, Dominique Martinet <asmadeus@codewreck.org>, Christian Schoenebeck <linux_oss@crudebyte.com>, David Howells <dhowells@redhat.com>, Marc Dionne <marc.dionne@auristor.com>, Chris Mason <clm@fb.com>, Josef Bacik <josef@toxicpanda.com>, David Sterba <dsterba@suse.com>, Xiubo Li <xiubli@redhat.com>, Ilya Dryomov <idryomov@gmail.com>, Jan Harkes <jaharkes@cs.cmu.edu>, coda@cs.cmu.edu, Tyler Hicks <code@tyhicks.com>, Gao Xiang <xiang@kernel.org>, Chao Yu <chao@kernel.org>, Yue Hu <huyue2@coolpad.com>, Jeffle Xu <jefflexu@linux.alibaba.com>, Namjae Jeon <linkinjeon@kernel.org>, Sungjong Seo <sj1557.seo@samsung.com>, Jan Kara <jack@suse.com>, Theodore Ts'o <tytso@mit.edu>, Andreas Dilger <adilger.kernel@dilger.ca>, Jaegeuk Kim <jaegeuk@kernel.org>, OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>, Miklos Szeredi <miklos@szeredi.hu>, Bob Peterson <rpeterso@redhat.com>, Andreas Gruenbacher <agruenba@redhat.com>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Tejun Heo <tj@kernel.org>, Alexander Viro <viro@zeniv.linux.org.uk>, Christian Brauner <brauner@kernel.org>, Trond Myklebust <trond.myklebust@hammerspace.com>, Anna Schumaker <anna@kernel.org>, Konstantin Komarov <almaz.alexandrovich@paragon-software.com>, Mark Fasheh <mark@fasheh.com>, Joel Becker <jlbec@evilplan.org>, Joseph Qi <joseph.qi@linux.alibaba.com>, Mike Marshall <hubcap@omnibond.com>, Martin Brandenburg <martin@omnibond.com>, Luis Chamberlain <mcgrof@kernel.org>, Kees Cook <keescook@chromium.org>, Iurii Zaikin <yzaikin@google.com>, Steve French <sfrench@samba.org>, Paulo Alcantara <pc@manguebit.com>, Ronnie Sahlberg <lsahlber@redhat.com>, Shyam Prasad N <sprasad@microsoft.com>, Tom Talpey <tom@talpey.com>, Sergey Senozhatsky <senozhatsky@chromium.org>, Richard Weinberger <richard@nod.at>, Hans de Goede <hdegoede@redhat.com>, Hugh Dickins <hughd@google.com>, Andrew Morton <akpm@linux-foundation.org>, "Darrick J. Wong" <djwong@kernel.org> Cc: Dave Chinner <david@fromorbit.com>, v9fs@lists.linux.dev, linux-kernel@vger.kernel.org, linux-afs@lists.infradead.org, linux-btrfs@vger.kernel.org, ceph-devel@vger.kernel.org, codalist@coda.cs.cmu.edu, ecryptfs@vger.kernel.org, linux-erofs@lists.ozlabs.org, linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, cluster-devel@redhat.com, linux-nfs@vger.kernel.org, ntfs3@lists.linux.dev, ocfs2-devel@lists.linux.dev, devel@lists.orangefs.org, linux-cifs@vger.kernel.org, samba-technical@lists.samba.org, linux-mtd@lists.infradead.org, linux-mm@kvack.org, linux-xfs@vger.kernel.org, Jeff Layton <jlayton@kernel.org> X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=4474; i=jlayton@kernel.org; h=from:subject:message-id; bh=BvE/6xVatY3gzbwR0vDrqr3MzJ01oINoYu0cSNelaB8=; b=owEBbQKS/ZANAwAIAQAOaEEZVoIVAcsmYgBksIIu4PKEKGnoDdi+GMLN5ufs2UB8ZsDTn9Oqp SYtweP3skyJAjMEAAEIAB0WIQRLwNeyRHGyoYTq9dMADmhBGVaCFQUCZLCCLgAKCRAADmhBGVaC FXJhEADW493xZyCYf/hlVo1POCOZGol0XDpJIN1EQK3h+61XPis26awGDTcXczc9yZK/JvZV7oC VtVStL44kvzeqn7kh1AH/EuLmeazbYMEFTdl5PiizH53xrWmidL26fTjpjn01gvjb9Y5gGXTvuI h0JLInpNr5Hn509RQU2T5/D8WBKVnLWeHB/itiDWCZ1CG8iFNWfgbgC/bpdW2+H0eIDHvr6bUcJ m0mfxwAUL6lA/b/G8kmsdj0YEEWf2bOLzdxZcQPh/MEfkRuKwWqy9d5mFLJlJ5GiheG9qiqOwOA wLz9M0J4e32Di/q+QL/HpihUZOB0jrZB+bRhKxqWD04cFRtTTwE15w/xGAgjvPLe2l+sNzEUxoq nIscPnAScgiRW3Bzq6PUd7ljrtLvvU6Vcgd0HqFcyfn9APLCjnLCckVW7S0ofkRL7oksLIoSGDJ qo/IpJl4X/Mu1LBY//fFZp6QVhp54iwAR+D7VJ3z7wtZSktaXJ9f1o0qcT1Bo254702FlLGvbxf Bkj6FZDMZrSXrx81pjrLvUB8jCQQ13oz7O3kmOzVX4pLmnO9PRLcQLj14velupamDvwexZgudyW jiqR3IwVXCTiN2WgmssqUyuQi+GQ1LKePEwVpDx8izF0VnbQshX6OqMvuRzVcDG29pzQBTc0dy+ lAVc/7Mp3vHZu0g== X-Developer-Key: i=jlayton@kernel.org; a=openpgp; fpr=4BC0D7B24471B2A184EAF5D3000E684119568215 X-Rspamd-Queue-Id: 6DD231C002B X-Rspam-User: X-Stat-Signature: 6baz5mzwrhctfutnmgsxmz3ut1ea8rtd X-Rspamd-Server: rspam01 X-HE-Tag: 1689289271-533467 X-HE-Meta: U2FsdGVkX1/lgRmooZz4jTdJySXZC5o+dI52RwWa7GyirekXyxQm/5+n0+B8eJJgn082QOIPWcSBC3HY57/WdIpYQ2xO44orbhu9vJ7WSXpxq1Jq/SGrZHlhprz8k1WWzyrhlvpGZqbCUuCzKtuhnSbADHblUMBZJjvtHp5e+MrrOK2tz5uRvB95MFGjCTg8mWz2DHalkTOxt0EU5KD+9i9LJUOCEuhZlNF2+cUxnmWp8lcjB1yL9sl9pCIpYObZuNs1Mh2zDSAxgMHSvN0mxzAlFrNnx9CTghtji8EcftsL05LH9qg42Qf6saDKSZ5yN49tKQLOoe40pq3IX3i04liHQFoeWC6DU76rdWWxVR+Yzu48VVIKzHj2aYJXq0GobxVAVEV0U1C3GrChNG2kphyDoSX6MueD33RmjbLLeDNtgFuBBuoXCAFjW7iiW+JTc9LUvxyb1+a9WD8HL7oy3fin8eaHGaBhfM6+Z6CuVZStbcguSTJd78Q8Sw5WrrFOdiXLcSfejd9ohXm7COzKWHJq0D6zwPCyGPYxsaXeDc/nzebArqev6rZQKb7sDMFH1fePAvoCSiuMmphyPp4rj1+6xZPI8v0PUKx2Qfpstzjh07jmXb8MnYlJmQ5xOmXicysIiGemV2l7etG2eHHvBg3XnUYnZ8m1klX8pYmxFn3JwSVOrkjPgigvBis4IcTZQzVGUDEEFhcuB+1ZhhvXeOnci/bDvLC44Laie2LtlEVN1H8pZtp1ek8SdTYYvNhVuX8P09l01JE3ICgTbV2QTObEXCPmxYCEs26tlURPDceGnEfPX7ho9vnDqcr7Rog9BUy72WB+r2uLgtIJLYWg6QzonvWUKHj7oF5LiHsxOhkSz3VikqywZGe8SVcuXZbjl0cDlLC+CEAvQMyvPe28Rk5pywUEsyWp/0ZmSk/qKzzoF0TL11zg0xS4eYfw6G/jALUtsTHfAHWpJCOvaO3 GgBMt6jd oijohTzu2ODtmina82hrVYNev3irr80KVWvSXHnAeuVBnkFY0rRnRvrSccvJuKIaN4G4v1PtfDcxkTDxPazyQJiLfAEHUHsnfma62pOUqSw19lwbBWr7v3H1OIldFg2VqNW7ue5Yal1KxSHbrllbE+tY2RA25Bw3OvXnfrAb+t0t40SnjX8h3d1a172HmyOxH57fNvMVaJ2cIia6Ee90PA5rGTT5x8A/3NFLiHrnOmNiRPi+2+rebtsYGceqQtHIeOgMNGV2KuZKFMfT3zLvVjEFp26C8rQikLkPHpoe5OJdZEMQ+1mScvX/tqSwwxxz1G1cr6zZt5nkc1m4AbsoNcqtAWdvA0sSBkV0G X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: <linux-mm.kvack.org> |
Series |
fs: implement multigrain timestamps
|
expand
|
The VFS always uses coarse-grained timestamps when updating the ctime and mtime after a change. This has the benefit of allowing filesystems to optimize away a lot metadata updates, down to around 1 per jiffy, even when a file is under heavy writes. Unfortunately, this coarseness has always been an issue when we're exporting via NFSv3, which relies on timestamps to validate caches. A lot of changes can happen in a jiffy, so timestamps aren't sufficient to help the client decide to invalidate the cache. Even with NFSv4, a lot of exported filesystems don't properly support a change attribute and are subject to the same problems with timestamp granularity. Other applications have similar issues with timestamps (e.g backup applications). If we were to always use fine-grained timestamps, that would improve the situation, but that becomes rather expensive, as the underlying filesystem would have to log a lot more metadata updates. What we need is a way to only use fine-grained timestamps when they are being actively queried. The idea is to use an unused bit in the ctime's tv_nsec field to mark when the mtime or ctime has been queried via getattr. Once that has been marked, the next m/ctime update will use a fine-grained timestamp. This patch series is based on top of Christian's vfs.all branch, which has the recent conversion to the new ctime accessors. It should apply cleanly on top of linux-next. While the patchset does work, I'm mostly looking for feedback on the core infrastructure API. Does this look reasonable? Am I missing any races? Signed-off-by: Jeff Layton <jlayton@kernel.org> base-commit: cf22d118b89a09a0160586412160d89098f7c4c7 --- Jeff Layton (8): fs: pass the request_mask to generic_fillattr fs: add infrastructure for multigrain timestamps tmpfs: bump the mtime/ctime/iversion when page becomes writeable tmpfs: add support for multigrain timestamps xfs: XFS_ICHGTIME_CREATE is unused xfs: switch to multigrain timestamps ext4: switch to multigrain timestamps btrfs: convert to multigrain timestamps fs/9p/vfs_inode.c | 4 +- fs/9p/vfs_inode_dotl.c | 4 +- fs/afs/inode.c | 2 +- fs/btrfs/file.c | 24 ++-------- fs/btrfs/inode.c | 2 +- fs/btrfs/super.c | 5 ++- fs/ceph/inode.c | 2 +- fs/coda/inode.c | 3 +- fs/ecryptfs/inode.c | 5 ++- fs/erofs/inode.c | 2 +- fs/exfat/file.c | 2 +- fs/ext2/inode.c | 2 +- fs/ext4/inode.c | 2 +- fs/ext4/super.c | 2 +- fs/f2fs/file.c | 2 +- fs/fat/file.c | 2 +- fs/fuse/dir.c | 2 +- fs/gfs2/inode.c | 2 +- fs/hfsplus/inode.c | 2 +- fs/inode.c | 98 +++++++++++++++++++++++++++++------------ fs/kernfs/inode.c | 2 +- fs/libfs.c | 4 +- fs/minix/inode.c | 2 +- fs/nfs/inode.c | 2 +- fs/nfs/namespace.c | 3 +- fs/ntfs3/file.c | 2 +- fs/ocfs2/file.c | 2 +- fs/orangefs/inode.c | 2 +- fs/proc/base.c | 4 +- fs/proc/fd.c | 2 +- fs/proc/generic.c | 2 +- fs/proc/proc_net.c | 2 +- fs/proc/proc_sysctl.c | 2 +- fs/proc/root.c | 3 +- fs/smb/client/inode.c | 2 +- fs/smb/server/smb2pdu.c | 22 ++++----- fs/smb/server/vfs.c | 3 +- fs/stat.c | 59 ++++++++++++++++++++----- fs/sysv/itree.c | 3 +- fs/ubifs/dir.c | 2 +- fs/udf/symlink.c | 2 +- fs/vboxsf/utils.c | 2 +- fs/xfs/libxfs/xfs_shared.h | 2 - fs/xfs/libxfs/xfs_trans_inode.c | 8 ++-- fs/xfs/xfs_iops.c | 4 +- fs/xfs/xfs_super.c | 2 +- include/linux/fs.h | 47 ++++++++++++++++++-- mm/shmem.c | 16 ++++++- 48 files changed, 248 insertions(+), 129 deletions(-) --- base-commit: cf22d118b89a09a0160586412160d89098f7c4c7 change-id: 20230713-mgctime-f2a9fc324918 Best regards,