On 8/17/22 13:04, Dylan Yudaken wrote:
On Wed, 2022-08-17 at 11:48 +0100, Pavel Begunkov wrote:
On 8/16/22 09:37, Dylan Yudaken wrote:
On Tue, 2022-08-16 at 08:42 +0100, Pavel Begunkov wrote:
Considering limited amount of slots some users struggle with
registration time notification tag assignment as it's hard to
manage
notifications using sequence numbers. Add a simple feature that
copies
sqe->user_data of a send(+flush) request into the notification
CQE it
flushes (and only when it's flushes).
I think for this to be useful I think it would also be needed to
have
flags on the generated CQE.
If there are more CQEs coming for the same request it should have
IORING_CQE_F_MORE set. Otherwise user space would not be able to
know
if it is able to reuse local data.
If you want to have:
expect_more = cqe->flags & IORING_CQE_F_MORE;
Then in the current form you can perfectly do that with
// MSG_WAITALL
expect_more = (cqe->res == io_len);
// !MSG_WAITALL,
expect_more = (cqe->res >= 0);
But might be more convenient to have IORING_CQE_F_MORE set,
one problem is a slight change of (implicit) semantics, i.e.
we don't execute linked requests when filling a IORING_CQE_F_MORE
CQE + CQE ordering implied from that.
It's maybe worth to not rely on the link failing concept for
deciding whether to flush or not.
Is the ordering guaranteed then to be <send cqe>, <notif cqe>?
Not yet, need to send this patch
https://github.com/isilence/linux/commit/9a1464905be3fc0cee4f68b01e43c5ad14a05b06
If so I would put the IORING_CQE_F_MORE more as a nice to have for
consistency with other ops
Additionally it would need to provide a way of disambiguating the
send
CQE with the flush CQE.
Do you mean like IORING_CQE_F_NOTIF from 1/2?
Apologies - I missed that
--
Pavel Begunkov