From: Jens Axboe <[email protected]>
To: Pavel Begunkov <[email protected]>,
io-uring <[email protected]>
Subject: Re: [RFC] fixed files
Date: Sat, 8 Feb 2020 13:15:18 -0700 [thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
On 2/8/20 6:28 AM, Pavel Begunkov wrote:
> Hi,
>
> As you remember, splice(2) needs two fds, and it's a bit of a pain
> finding a place for the second REQ_F_FIXED_FILE flag. So, I was
> thinking, can we use the last (i.e. sign) bit to mark an fd as fixed? A
> lot of userspace programs consider any negative result of open() as an
> error, so it's more or less safe to reuse it.
>
> e.g.
> fill_sqe(fd) // is not fixed
> fill_sqe(buf_idx | LAST_BIT) // fixed file
Right now we only support 1024 fixed buffers anyway, so we do have some
space there. If we steal a bit, it'll still allow us to expand to 32K of
fixed buffers in the future.
It's a bit iffy, but like you, I don't immediately see a better way to
do this that doesn't include stealing an IOSQE bit or adding a special
splice flag for it. Might still prefer the latter, to be honest...
--
Jens Axboe
next prev parent reply other threads:[~2020-02-08 20:15 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-08 13:28 [RFC] fixed files Pavel Begunkov
2020-02-08 20:15 ` Jens Axboe [this message]
2020-02-09 12:18 ` Pavel Begunkov
2020-02-09 17:04 ` Jens Axboe
2020-02-09 17:53 ` Pavel Begunkov
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 \
[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