From: Jens Axboe <[email protected]>
To: Hao Xu <[email protected]>, [email protected]
Subject: Re: [PATCHSET 0/2] Add support for IORING_RECVSEND_POLL_FIRST
Date: Fri, 29 Apr 2022 12:44:06 -0600 [thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
On 4/29/22 12:31 PM, Hao Xu wrote:
> On 4/27/22 09:54, Jens Axboe wrote:
>> Hi,
>>
>> I had a re-think on the flags2 addition [1] that was posted earlier
>> today, and I don't really like the fact that flags2 then can't work
>> with ioprio for read/write etc. We might also want to extend the
>> ioprio field for other types of IO in the future.
>>
>> So rather than do that, do a simpler approach and just add an io_uring
>> specific flag set for send/recv and friends. This then allow setting
>> IORING_RECVSEND_POLL_FIRST in sqe->addr2 for those, and if set, io_uring
>> will arm poll first rather than attempt a send/recv operation.
>>
>> [1] https://lore.kernel.org/io-uring/[email protected]/
>>
>
> Hi Jens,
> Could we use something like the high bits of sqe->fd to store general
> flags2 since I saw the number of open FDs can be about (1<<20) at
> most. Though I'm not sure if we can assume the limitation of fd won't
> change in the future..
I think that's a bit iffy, it's pretty universally true (at least on
*NIX) that and fd is a signed int. So I'd be hesitant to do that. I
don't mind the flags here, generally we have potentially 3 per request:
- SQE specific ones, these are the IOSQE_* flags and are meant to be
generally applicable to all/most commands. io_uring internal, have no
meaning outside of io_uring.
- Some requests are layered on top of existing functionality, the
recv/recvmsg is a good example. They have their own sets of flags. We
generally use the sqe->rw_flags space for those.
- Lastly, io_uring modifiers to specific requests. That's what this
patch adds. They don't make sense to the lower layers, but they are
specific to this request type for io_uring.
The 3rd type is put in sqe->rw_flags for io_uring specific opcodes, but
for commands that already have flags in the 2nd category, we have to put
them somewhere else. Not a big deal imho, at least as long as the
request type has space in the sqe for it. They generally do, they did in
this case.
--
Jens Axboe
prev parent reply other threads:[~2022-04-29 18:44 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-27 1:54 [PATCHSET 0/2] Add support for IORING_RECVSEND_POLL_FIRST Jens Axboe
2022-04-27 1:54 ` [PATCH 1/2] io_uring: check IOPOLL/ioprio support upfront Jens Axboe
2022-04-27 1:54 ` [PATCH 2/2] io_uring: add POLL_FIRST support for send/sendmsg and recv/recvmsg Jens Axboe
2022-04-27 3:57 ` [PATCHSET 0/2] Add support for IORING_RECVSEND_POLL_FIRST Hao Xu
2022-04-29 18:31 ` Hao Xu
2022-04-29 18:40 ` Hao Xu
2022-04-29 18:44 ` Jens Axboe
2022-04-29 18:44 ` Jens Axboe [this message]
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