IO-Uring Archive on lore.kernel.org
 help / color / Atom feed
From: "Carter Li 李通洲" <carter.li@eoitek.com>
To: io-uring <io-uring@vger.kernel.org>
Subject: [FEATURE REQUEST] Specify a sqe won't generate a cqe
Date: Fri, 14 Feb 2020 08:29:24 +0000
Message-ID: <9A41C624-3D2C-40BC-A910-59CBDC5BB76E@eoitek.com> (raw)

To implement io_uring_wait_cqe_timeout, we introduce a magic number
called `LIBURING_UDATA_TIMEOUT`. The problem is that not only we
must make sure that users should never set sqe->user_data to
LIBURING_UDATA_TIMEOUT, but also introduce extra complexity to
filter out TIMEOUT cqes.

Former discussion: https://github.com/axboe/liburing/issues/53

I’m suggesting introducing a new SQE flag called IOSQE_IGNORE_CQE
to solve this problem.

For a sqe tagged with IOSQE_IGNORE_CQE flag, it won’t generate a cqe
on completion. So that IORING_OP_TIMEOUT can be filtered on kernel
side.

In addition, `IOSQE_IGNORE_CQE` can be used to save cq size.

For example `POLL_ADD(POLLIN)->READ/RECV` link chain, people usually
don’t care the result of `POLL_ADD` is ( since it will always be
POLLIN ), `IOSQE_IGNORE_CQE` can be set on `POLL_ADD` to save lots
of cq size.

Besides POLL_ADD, people usually don’t care the result of POLL_REMOVE
/TIMEOUT_REMOVE/ASYNC_CANCEL/CLOSE. These operations can also be tagged
with IOSQE_IGNORE_CQE.

Thoughts?

             reply index

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-14  8:29 Carter Li 李通洲 [this message]
2020-02-14 10:34 ` Pavel Begunkov
2020-02-14 11:27   ` Carter Li 李通洲
2020-02-14 12:52     ` Pavel Begunkov
2020-02-14 13:27       ` Carter Li 李通洲
2020-02-14 14:16         ` 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 \
    --in-reply-to=9A41C624-3D2C-40BC-A910-59CBDC5BB76E@eoitek.com \
    --to=carter.li@eoitek.com \
    --cc=io-uring@vger.kernel.org \
    /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

IO-Uring Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/io-uring/0 io-uring/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 io-uring io-uring/ https://lore.kernel.org/io-uring \
		io-uring@vger.kernel.org
	public-inbox-index io-uring

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.io-uring


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git