From: Dominique Martinet <[email protected]>
To: Alexander Viro <[email protected]>,
Christian Brauner <[email protected]>,
Jens Axboe <[email protected]>,
Pavel Begunkov <[email protected]>,
Stefan Roesch <[email protected]>
Cc: [email protected], [email protected],
[email protected],
Dominique Martinet <[email protected]>
Subject: [PATCH RFC 0/2] io_uring: add getdents support, take 2
Date: Sat, 22 Apr 2023 17:40:17 +0900 [thread overview]
Message-ID: <[email protected]> (raw)
This is an attempt to revive discussion after bringing it up as a reply
to the last attempt last week.
Since the problem with the previous attempt at adding getdents to
io_uring was that offset was problematic, we can just not add an offset
parameter: using different offsets is rarely useful in practice (maybe
for some cacheless userspace NFS server?) and more isn't worth the cost
of allowing arbitrary offsets: just allow rewind as a flag instead.
[happy to drop even that flag for what I care about, but that might be
useful enough on its own as io_uring rightfully has no seek API]
The new API does nothing that cannot be achieved with plain syscalls so
it shouldn't be introducing any new problem, the only downside is that
having the state in the file struct isn't very uring-ish and if a
better solution is found later that will probably require duplicating
some logic in a new flag... But that seems like it would likely be a
distant future, and this version should be usable right away.
To repeat the rationale for having getdents available from uring as it
has been a while, while I believe there can be real performance
improvements as suggested in [1], the real reason is to allow coherency
in code: applications using io_uring usually center their event loop
around the ring, and having the occasional synchronous getdents call in
there is cumbersome and hard to do properly when you consider e.g. a
slow or acting up network fs...
[1] https://lore.kernel.org/linux-fsdevel/[email protected]/
(unfortunately the source is no longer available...)
liburing implementation:
https://github.com/martinetd/liburing/commits/getdents
(will submit properly after initial discussions here)
Previous discussion:
https://lore.kernel.org/all/[email protected]/T/#m517583f23502f32b040c819d930359313b3db00c
Signed-off-by: Dominique Martinet <[email protected]>
---
Dominique Martinet (2):
fs: split off vfs_getdents function of getdents64 syscall
io_uring: add support for getdents
fs/internal.h | 8 +++++++
fs/readdir.c | 33 +++++++++++++++++++++-------
include/uapi/linux/io_uring.h | 7 ++++++
io_uring/fs.c | 51 +++++++++++++++++++++++++++++++++++++++++++
io_uring/fs.h | 3 +++
io_uring/opdef.c | 8 +++++++
6 files changed, 102 insertions(+), 8 deletions(-)
---
base-commit: 6a8f57ae2eb07ab39a6f0ccad60c760743051026
change-id: 20230422-uring-getdents-2aab84d240aa
Best regards,
--
Dominique Martinet | Asmadeus
next reply other threads:[~2023-04-22 8:40 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-22 8:40 Dominique Martinet [this message]
2023-04-22 8:40 ` [PATCH RFC 1/2] fs: split off vfs_getdents function of getdents64 syscall Dominique Martinet
2023-04-22 10:34 ` Dominique Martinet
2023-04-22 8:40 ` [PATCH RFC 2/2] io_uring: add support for getdents Dominique Martinet
2023-04-23 22:40 ` Dave Chinner
2023-04-23 23:43 ` Dominique Martinet
2023-04-24 7:29 ` Clay Harris
2023-04-24 8:41 ` Dominique Martinet
2023-04-24 9:20 ` Clay Harris
2023-04-24 10:55 ` Dominique Martinet
2023-04-28 5:06 ` Dave Chinner
2023-04-28 6:14 ` Dominique Martinet
2023-04-28 11:27 ` Dominique Martinet
2023-04-30 23:15 ` Dave Chinner
2023-04-29 8:07 ` Dominique Martinet
2023-04-30 23:32 ` Dave Chinner
2023-05-01 0:49 ` Dominique Martinet
2023-05-01 7:16 ` Dave Chinner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230422-uring-getdents-v1-0-14c1db36e98c@codewreck.org \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox