From: Stefan Metzmacher <[email protected]>
To: Pavel Begunkov <[email protected]>,
io-uring <[email protected]>, Jens Axboe <[email protected]>
Cc: Dylan Yudaken <[email protected]>
Subject: Re: IORING_SEND_NOTIF_USER_DATA (was Re: IORING_CQE_F_COPIED)
Date: Fri, 21 Oct 2022 14:38:07 +0200 [thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
Am 21.10.22 um 13:26 schrieb Pavel Begunkov:
> On 10/21/22 11:15, Stefan Metzmacher wrote:
>> Hi Pavel, and others...
>>
>>>> As far as I can see io_send_zc_prep has this:
>>>>
>>>> if (unlikely(READ_ONCE(sqe->__pad2[0]) || READ_ONCE(sqe->addr3)))
>>>> return -EINVAL;
>>>>
>>>> both are u64...
>>>
>>> Hah, true, completely forgot about that one
>>
>> BTW: any comment on my "[RFC PATCH 0/8] cleanup struct io_uring_sqe layout"
>> thread, that would make it much easier to figure out which fields are used..., see
>> https://lore.kernel.org/io-uring/[email protected]/#r
>
> I admit the sqe layout is messy as there is no good separation b/w
> common vs opcode specific fields, but it's not like the new layout
> makes it much simpler.
Really?
> E.g. looking who is using a field will get more complicated.
Why should anyone care what fields other opcodes use
and how they are named.
For legacy reasons we have to live with
struct io_uring_sqe_common common; in the middle.
apart from that each opcode should be free to use
5 u64 fields and 1 u32 field.
But e.g.
+ /* IORING_OP_FALLOCATE */
+ struct io_uring_sqe_fallocate {
+ struct io_uring_sqe_hdr hdr;
+
+ __u64 offset;
+ __u64 length;
+ __u32 mode;
+ __u32 u32_ofs28;
+
+ struct io_uring_sqe_common common;
+
+ __u32 u32_ofs44;
+ __u64 u64_ofs48;
+ __u64 u64_ofs56;
+ } fallocate;
Immediately shows what's used and what not
and it avoids brain dead things like using
sqe->addr instead of sqe->len for the length.
And it makes it trivial to verify that the _prep function
rejects any unused field.
And it would it easier to write per opcode tracing code,
which can be easily analyzed.
> iow, no strong opinion on it.
>
> btw, will be happy to have the include guard patch from one of
> your branches
This one from the io_uring_livepatch.v6.1 branch?
https://git.samba.org/?p=metze/linux/wip.git;a=commitdiff;h=3c36e05baad737f5cb896fdc9fc53dc1b74d2499
metze
prev parent reply other threads:[~2022-10-21 12:38 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-14 11:06 IORING_CQE_F_COPIED Stefan Metzmacher
2022-10-17 16:46 ` IORING_CQE_F_COPIED Pavel Begunkov
2022-10-18 8:43 ` IORING_CQE_F_COPIED Stefan Metzmacher
2022-10-19 15:06 ` IORING_CQE_F_COPIED Pavel Begunkov
2022-10-19 16:12 ` IORING_CQE_F_COPIED Stefan Metzmacher
2022-10-20 2:24 ` IORING_CQE_F_COPIED Pavel Begunkov
2022-10-20 10:04 ` IORING_SEND_NOTIF_REPORT_USAGE (was Re: IORING_CQE_F_COPIED) Stefan Metzmacher
2022-10-20 13:46 ` Pavel Begunkov
2022-10-20 14:51 ` Stefan Metzmacher
2022-10-20 15:31 ` Pavel Begunkov
2022-10-21 9:36 ` Stefan Metzmacher
2022-10-21 11:09 ` Pavel Begunkov
2022-10-21 14:03 ` Stefan Metzmacher
2022-10-27 8:47 ` Stefan Metzmacher
2022-10-27 10:51 ` Pavel Begunkov
2022-10-20 10:10 ` IORING_SEND_NOTIF_USER_DATA " Stefan Metzmacher
2022-10-20 15:37 ` Pavel Begunkov
2022-10-21 8:32 ` Stefan Metzmacher
2022-10-21 9:27 ` Pavel Begunkov
2022-10-21 9:45 ` Stefan Metzmacher
2022-10-21 11:20 ` Pavel Begunkov
2022-10-21 12:10 ` Stefan Metzmacher
2022-10-21 10:15 ` Stefan Metzmacher
2022-10-21 11:26 ` Pavel Begunkov
2022-10-21 12:38 ` Stefan Metzmacher [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] \
[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