All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH v3 0/2] io_uring: add IORING_OP_UTIMENSAT
@ 2026-11-14 10:46 Méven Car
  2026-11-14 10:46 ` [RFC PATCH v3 1/2] fs: add filename_utimensat() Méven Car
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Méven Car @ 2026-11-14 10:46 UTC (permalink / raw)
  To: Jens Axboe
  Cc: io-uring, linux-fsdevel, Alexander Viro, Christian Brauner,
	Jan Kara, Méven Car

From: Méven Car <meven@kde.org>

A file manager or cp -p that copies many files sets the times of every
copy after its last write. KDE's KIO does not use io_uring yet, but
could in the future. In a KIO prototype that copies batches of small
files through io_uring, open, create, read and write run in the ring,
but the metadata of each copy is set outside the ring, with futimens()
and, when needed, fchmod() and fchown(). On NFS and SMB each of these
calls is a round trip to the server.

In that prototype, setting the metadata from a pool of 16 threads
instead of one file at a time cut the copy of 200 files of 4 KiB by 22%
on NFS and 45% on SMB. The test copied from ext4 to an NFS 4.2 and an
SMB mount of the same machine, over loopback with a netem delay of 2 ms
each way. An opcode would give the same parallelism from the ring, and
would let a copy be one linked chain per file: WRITE, UTIMENSAT, CLOSE.

Patch 1 splits filename_utimensat() out of do_utimes_path(), so that
io_uring can pass a name imported at submission time, as it does for
mkdirat and the other path ops.

Patch 2 adds IORING_OP_UTIMENSAT with the semantics of utimensat(2).
Like the other path ops it runs from io-wq.

IORING_OP_FCHMOD was proposed in 2024 [1] and not merged. The same
questions apply to fchmod and fchown, which a copy also needs, and a
single setattr opcode could set the mode, owner and times in one
->setattr() call. I started with the times because a copy always sets
them.

Testing: a userspace test of 30 cases (paths, AT_EMPTY_PATH on O_PATH
fds, NULL path, UTIME_OMIT, permission and read-only errors, links, copy
at submission, punt to io-wq on tmpfs and ramfs) passes in a qemu guest
on for-7.4/io_uring. A liburing helper, test and man page will follow
if the interface is acceptable.

[1] https://lore.kernel.org/io-uring/e291085644e14b3eb4d1c3995098bf4e@huawei.com/

Changes in v3:
- Drop patch 3, the inline attempt with FS_SETATTR_TIMES_NOWAIT and
  mnt_want_write_trylock(). It added generic VFS API for one filesystem,
  still ran the blocking parts of notify_change(), and looked the path
  up twice on every other filesystem. (Christian Brauner)
- Patch 1: add Jan Kara's Reviewed-by.

Changes in v2:
- A NULL path now sets the times through the fd itself, like
  do_utimes_fd(), instead of a lookup of an empty name. As with
  utimensat(2), it takes no flags (-EINVAL), an O_PATH fd gives -EBADF,
  and an open file that was unlinked needs no revalidation. (Sashiko)
- Patch 2 message: drop the wrong claim that AT_EMPTY_PATH on an O_PATH
  fd differs from the syscall.

v2: https://lore.kernel.org/io-uring/20261104110604.126717-1-meven29@gmail.com/
v1: https://lore.kernel.org/io-uring/20261030123945.1704118-1-meven@kde.org/

Méven Car (2):
  fs: add filename_utimensat()
  io_uring: add support for utimensat

 fs/internal.h                 |  2 +
 fs/utimes.c                   | 12 +++--
 include/uapi/linux/io_uring.h |  2 +
 io_uring/fs.c                 | 97 +++++++++++++++++++++++++++++++++++
 io_uring/fs.h                 |  4 ++
 io_uring/opdef.c              |  8 +++
 6 files changed, 122 insertions(+), 3 deletions(-)


base-commit: ecb6817b769fd7d71af2c9f446188649020b2e53
-- 
2.56.1


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

end of thread, other threads:[~2026-11-20 16:34 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-14 10:46 [RFC PATCH v3 0/2] io_uring: add IORING_OP_UTIMENSAT Méven Car
2026-11-14 10:46 ` [RFC PATCH v3 1/2] fs: add filename_utimensat() Méven Car
2026-11-14 10:46 ` [RFC PATCH v3 2/2] io_uring: add support for utimensat Méven Car
2026-11-20 10:33 ` [RFC PATCH v3 0/2] io_uring: add IORING_OP_UTIMENSAT Christian Brauner
2026-11-20 16:34   ` Jens Axboe

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.