All of lore.kernel.org
 help / color / mirror / Atom feed
From: Aleksa Sarai <cyphar@cyphar.com>
To: Jens Axboe <axboe@kernel.dk>
Cc: Josh Triplett <josh@joshtriplett.org>,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	io-uring@vger.kernel.org, linux-arch@vger.kernel.org,
	Alexander Viro <viro@zeniv.linux.org.uk>,
	Arnd Bergmann <arnd@arndb.de>
Subject: Re: [PATCH v4 2/3] fs: openat2: Extend open_how to allow userspace-selected fds
Date: Mon, 20 Apr 2020 12:06:42 +1000	[thread overview]
Message-ID: <20200420020642.xzkqikia6kmslkjh@yavin.dot.cyphar.com> (raw)
In-Reply-To: <b7dae79b-4c5f-65f6-0960-617070357201@kernel.dk>

[-- Attachment #1: Type: text/plain, Size: 1545 bytes --]

On 2020-04-19, Jens Axboe <axboe@kernel.dk> wrote:
> On 4/19/20 4:44 AM, Aleksa Sarai wrote:
> > On 2020-04-13, Josh Triplett <josh@joshtriplett.org> wrote:
> >> Inspired by the X protocol's handling of XIDs, allow userspace to select
> >> the file descriptor opened by openat2, so that it can use the resulting
> >> file descriptor in subsequent system calls without waiting for the
> >> response to openat2.
> >>
> >> In io_uring, this allows sequences like openat2/read/close without
> >> waiting for the openat2 to complete. Multiple such sequences can
> >> overlap, as long as each uses a distinct file descriptor.
> > 
> > I'm not sure I understand this explanation -- how can you trigger a
> > syscall with an fd that hasn't yet been registered (unless you're just
> > hoping the race goes in your favour)?
> 
> io_uring can do chains of requests, where each link in the chain isn't
> started until the previous one has completed. Hence if you know what fd
> that openat2 will return, you can submit a chain ala:
> 
> <open file X, give me fd Y><read from fd Y><close fd Y>
> 
> as a single submission. This isn't possible to do currently, as the read
> will depend on the output of the open, and we have no good way of
> knowing what that fd will be.

Ah! I was aware of io_uring's chaining feature but thought it had access
to the return of the previous stage -- now this makes much more sense.
Thanks.

-- 
Aleksa Sarai
Senior Software Engineer (Containers)
SUSE Linux GmbH
<https://www.cyphar.com/>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

  reply	other threads:[~2020-04-20  2:07 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-14  2:14 [PATCH v4 0/3] Support userspace-selected fds Josh Triplett
2020-04-14  2:15 ` [PATCH v4 1/3] fs: Support setting a minimum fd for "lowest available fd" allocation Josh Triplett
2020-04-14  2:15 ` [PATCH v4 2/3] fs: openat2: Extend open_how to allow userspace-selected fds Josh Triplett
2020-04-19 10:44   ` Aleksa Sarai
2020-04-19 21:18     ` David Laight
2020-04-19 22:22     ` Jens Axboe
2020-04-20  2:06       ` Aleksa Sarai [this message]
2020-04-20 21:14     ` Josh Triplett
     [not found]   ` <f969e7d45a8e83efc1ca13d675efd8775f13f376.1586830316.git.josh-iaAMLnmF4UmaiuxdJuQwMA@public.gmane.org>
2020-04-27 13:52     ` [fs] ce436509a8: ltp.openat203.fail kernel test robot
2020-04-27 13:52       ` kernel test robot
2020-04-27 13:52       ` [LTP] " kernel test robot
2020-04-27 14:27       ` Cyril Hrubis
2020-04-27 14:27         ` Cyril Hrubis
2020-04-27 14:27         ` Cyril Hrubis
2020-04-28  0:51         ` Aleksa Sarai
2020-04-28  0:51           ` Aleksa Sarai
2020-04-28  0:51           ` Aleksa Sarai
2020-04-28 15:30           ` Cyril Hrubis
2020-04-28 15:30             ` Cyril Hrubis
2020-04-28 15:30             ` Cyril Hrubis
2020-04-28 15:30             ` Cyril Hrubis
2020-04-28 15:35             ` [LTP] " Aleksa Sarai
2020-04-28 15:35               ` Aleksa Sarai
2020-04-28 15:35               ` Aleksa Sarai
2020-04-14  2:16 ` [PATCH v4 3/3] fs: pipe2: Support O_SPECIFIC_FD Josh Triplett

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=20200420020642.xzkqikia6kmslkjh@yavin.dot.cyphar.com \
    --to=cyphar@cyphar.com \
    --cc=arnd@arndb.de \
    --cc=axboe@kernel.dk \
    --cc=io-uring@vger.kernel.org \
    --cc=josh@joshtriplett.org \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /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 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.