linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 0/9] fs: implement multigrain timestamps
@ 2023-05-18 11:47 Jeff Layton
  2023-05-18 11:47 ` [PATCH v4 1/9] fs: pass the request_mask to generic_fillattr Jeff Layton
                   ` (9 more replies)
  0 siblings, 10 replies; 31+ messages in thread
From: Jeff Layton @ 2023-05-18 11:47 UTC (permalink / raw)
  To: Alexander Viro, Christian Brauner, Darrick J. Wong, Hugh Dickins,
	Andrew Morton, Dave Chinner, Chuck Lever
  Cc: Jan Kara, Amir Goldstein, David Howells, Neil Brown,
	Matthew Wilcox, Andreas Dilger, Theodore T'so, Chris Mason,
	Josef Bacik, David Sterba, Namjae Jeon, Steve French,
	Sergey Senozhatsky, Tom Talpey, linux-fsdevel, linux-kernel,
	linux-xfs, linux-btrfs, linux-ext4, linux-mm, linux-nfs,
	linux-cifs

v4:
- add request_mask argument to generic_fillattr
- Drop current_ctime helper and just code functionality into current_time
- rework i_ctime accessor functions

A few weeks ago, during one of the discussions around i_version, Dave
Chinner wrote this:

"You've missed the part where I suggested lifting the "nfsd sampled
i_version" state into an inode state flag rather than hiding it in
the i_version field. At that point, we could optimise away the
secondary ctime updates just like you are proposing we do with the
i_version updates.  Further, we could also use that state it to
decide whether we need to use high resolution timestamps when
recording ctime updates - if the nfsd has not sampled the
ctime/i_version, we don't need high res timestamps to be recorded
for ctime...."

While I don't think we can practically optimize away ctime updates
like we do with i_version, I do like the idea of using this scheme to
indicate when we need to use a high-res timestamp.

The basic idea here is to use an unused bit in the timespec64.tv_nsec
field to act as a flag to indicate that the value was queried since
the last time we updated it. If that flag is set when we go to update
the timestamp, we'll clear it and grab a fine-grained ktime value for
the update.

The first couple of patches add the necessary infrastructure, and the
last several patches update various filesystems to use it. For now, I'm
focusing on widely-used, exportable filesystems, but this scheme is
probably suitable for most filesystems in the kernel.

Note that this does cause at least one test failure with LTP's statx06
test. I have submitted a patch to fix the issue (by changing how it
fetches the "after" timestamp in that test).

Jeff Layton (9):
  fs: pass the request_mask to generic_fillattr
  fs: add infrastructure for multigrain inode i_m/ctime
  overlayfs: allow it to handle multigrain timestamps
  nfsd: ensure we use ctime_peek to grab the inode->i_ctime
  ksmbd: use ctime_peek to grab the ctime out of the inode
  tmpfs: add support for multigrain timestamps
  xfs: switch to multigrain timestamps
  ext4: convert 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/delayed-inode.c      |  2 +-
 fs/btrfs/inode.c              |  4 +--
 fs/btrfs/super.c              |  5 +--
 fs/btrfs/tree-log.c           |  2 +-
 fs/ceph/inode.c               |  2 +-
 fs/cifs/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               | 19 ++++++++--
 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                    | 48 +++++++++++++++++++++----
 fs/kernfs/inode.c             |  2 +-
 fs/ksmbd/smb2pdu.c            | 28 +++++++--------
 fs/ksmbd/vfs.c                |  3 +-
 fs/libfs.c                    |  4 +--
 fs/minix/inode.c              |  2 +-
 fs/nfs/inode.c                |  2 +-
 fs/nfs/namespace.c            |  3 +-
 fs/nfsd/nfsfh.c               | 11 ++++--
 fs/ntfs3/file.c               |  2 +-
 fs/ocfs2/file.c               |  2 +-
 fs/orangefs/inode.c           |  2 +-
 fs/overlayfs/file.c           |  7 ++--
 fs/overlayfs/util.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/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_inode_buf.c |  2 +-
 fs/xfs/xfs_inode_item.c       |  2 +-
 fs/xfs/xfs_iops.c             |  4 +--
 fs/xfs/xfs_super.c            |  2 +-
 include/linux/fs.h            | 68 +++++++++++++++++++++++++++++++++--
 mm/shmem.c                    |  4 +--
 52 files changed, 260 insertions(+), 95 deletions(-)

-- 
2.40.1


^ permalink raw reply	[flat|nested] 31+ messages in thread

end of thread, other threads:[~2023-06-14  6:30 UTC | newest]

Thread overview: 31+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-18 11:47 [PATCH v4 0/9] fs: implement multigrain timestamps Jeff Layton
2023-05-18 11:47 ` [PATCH v4 1/9] fs: pass the request_mask to generic_fillattr Jeff Layton
2023-05-23  9:17   ` Jan Kara
2023-05-18 11:47 ` [PATCH v4 2/9] fs: add infrastructure for multigrain inode i_m/ctime Jeff Layton
2023-05-23 10:02   ` Jan Kara
2023-05-23 10:17     ` Jan Kara
2023-05-23 10:56       ` Jeff Layton
2023-05-23 11:01         ` Christian Brauner
2023-05-23 11:15           ` Jeff Layton
2023-06-13 19:47       ` Jeff Layton
2023-05-23 10:38     ` Christian Brauner
2023-05-23 10:40     ` Jeff Layton
2023-05-23 12:46       ` Jan Kara
2023-06-13 13:09         ` Jeff Layton
2023-06-14  6:29           ` Christian Brauner
2023-05-18 11:47 ` [PATCH v4 3/9] overlayfs: allow it to handle multigrain timestamps Jeff Layton
2023-05-18 11:47 ` [PATCH v4 4/9] nfsd: ensure we use ctime_peek to grab the inode->i_ctime Jeff Layton
2023-05-18 13:43   ` Chuck Lever III
2023-05-18 15:31     ` Jeff Layton
2023-05-19 10:36       ` Christian Brauner
2023-05-19 11:22         ` Jeff Layton
2023-05-18 11:47 ` [PATCH v4 5/9] ksmbd: use ctime_peek to grab the ctime out of the inode Jeff Layton
2023-05-18 11:47 ` [PATCH v4 6/9] tmpfs: add support for multigrain timestamps Jeff Layton
2023-05-18 11:47 ` [PATCH v4 7/9] xfs: switch to " Jeff Layton
2023-05-18 11:47 ` [PATCH v4 8/9] ext4: convert " Jeff Layton
2023-05-20 20:29   ` Theodore Ts'o
2023-05-18 11:47 ` [PATCH v4 9/9] btrfs: " Jeff Layton
2023-05-22  9:56   ` David Sterba
2023-05-22 10:08     ` Jeff Layton
2023-05-22 10:53       ` Christian Brauner
2023-05-22  9:54 ` [PATCH v4 0/9] fs: implement " Christian Brauner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).