From: Miklos Szeredi <[email protected]>
To: Josh Triplett <[email protected]>
Cc: Michael Kerrisk <[email protected]>,
[email protected],
"[email protected]" <[email protected]>,
lkml <[email protected]>,
Alexander Viro <[email protected]>,
Arnd Bergmann <[email protected]>, Jens Axboe <[email protected]>,
Aleksa Sarai <[email protected]>,
linux-man <[email protected]>,
Linux API <[email protected]>
Subject: Re: [PATCH v5 2/3] fs: openat2: Extend open_how to allow userspace-selected fds
Date: Thu, 23 Apr 2020 11:46:59 +0200 [thread overview]
Message-ID: <CAJfpegv-zRp3a3JcmCO4JpXB=f32=TK=+jP1o-peqqxffT5ERw@mail.gmail.com> (raw)
In-Reply-To: <CAJfpegvcW9Sic8ZXgWfFQ3d8JTr53XABfP8rZzsVhCDBKCgMBw@mail.gmail.com>
On Thu, Apr 23, 2020 at 11:20 AM Miklos Szeredi <[email protected]> wrote:
>
> On Thu, Apr 23, 2020 at 9:57 AM Miklos Szeredi <[email protected]> wrote:
> >
> > On Thu, Apr 23, 2020 at 9:45 AM Miklos Szeredi <[email protected]> wrote:
> >
> > > > I would prefer to not introduce that limitation in the first place, and
> > > > instead open normal file descriptors.
> > > >
> > > > > The point of O_SPECIFIC_FD is to be able to perform short
> > > > > sequences of open/dosomething/close without having to block and having
> > > > > to issue separate syscalls.
> > > >
> > > > "close" is not a required component. It's entirely possible to use
> > > > io_uring to open a file descriptor, do various things with it, and then
> > > > leave it open for subsequent usage via either other io_uring chains or
> > > > standalone syscalls.
> > >
> > > If this use case arraises, we could add an op to dup/move a private
> > > descriptor to a public one. io_uring can return values, right?
> > >
> > > Still not convinced...
> >
> > Oh, and we haven't even touched on the biggest advantage of a private
> > fd table: not having to dirty a cacheline on fdget/fdput due to the
> > possibility of concurrent close() in a MT application.
> >
> > I believe this is a sticking point in some big enterprise apps and it
> > may even be a driving force for io_uring.
>
> https://lwn.net/Articles/787473/
>
> And an interesting (very old) article referenced from above, that
> gives yet a new angle on fd allocation issues:
>
> https://lwn.net/Articles/236843/
>
> A private fd space would be perfect for libraries such as glibc.
Ah, io_uring already implements a fixed private fd table via
io_uring_register(IORING_REGISTER_FILES,...), we just need a way to
wire up open, socket, accept, etc. to fill a slot in that table
instead of, or in addition to allocating a slot in the fd_table.
Thanks,
Miklos
next prev parent reply other threads:[~2020-04-23 9:47 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-22 5:19 [PATCH v5 0/3] Support userspace-selected fds Josh Triplett
2020-04-22 5:19 ` [PATCH v5 1/3] fs: Support setting a minimum fd for "lowest available fd" allocation Josh Triplett
2020-04-22 6:06 ` Michael Kerrisk (man-pages)
2020-04-23 1:12 ` Dmitry V. Levin
2020-04-23 4:51 ` Josh Triplett
2020-04-23 9:24 ` Arnd Bergmann
2020-04-22 5:20 ` [PATCH v5 2/3] fs: openat2: Extend open_how to allow userspace-selected fds Josh Triplett
2020-04-22 6:06 ` Michael Kerrisk (man-pages)
2020-04-22 7:55 ` Miklos Szeredi
2020-04-23 0:48 ` Josh Triplett
2020-04-23 4:24 ` Miklos Szeredi
2020-04-23 4:42 ` Josh Triplett
2020-04-23 6:04 ` Miklos Szeredi
2020-04-23 7:33 ` Josh Triplett
2020-04-23 7:45 ` Miklos Szeredi
2020-04-23 7:57 ` Miklos Szeredi
2020-04-23 9:20 ` Miklos Szeredi
2020-04-23 9:46 ` Miklos Szeredi [this message]
2020-04-23 8:06 ` Josh Triplett
2020-04-22 5:20 ` [PATCH v5 3/3] fs: pipe2: Support O_SPECIFIC_FD Josh Triplett
2020-04-22 6:06 ` Michael Kerrisk (man-pages)
2020-04-22 15:44 ` Florian Weimer
2020-04-23 0:44 ` Josh Triplett
2020-04-22 6:05 ` [PATCH v5 0/3] Support userspace-selected fds Michael Kerrisk (man-pages)
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='CAJfpegv-zRp3a3JcmCO4JpXB=f32=TK=+jP1o-peqqxffT5ERw@mail.gmail.com' \
[email protected] \
[email protected] \
[email protected] \
[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