public inbox for io-uring@vger.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: io-uring@vger.kernel.org
Subject: 
Date: Fri, 11 Jul 2025 17:59:22 -0600	[thread overview]
Message-ID: <20250712000344.1579663-1-axboe@kernel.dk> (raw)
In-Reply-To: <[PATCHSET 0/3] Add support for IORING_CQE_F_POLLED>

Hi,

It can be useful to know if a given file/socket/pipe needed to go
through poll arming to successfully execute the request. For example, a
write to a pipe will normally succeed inline. Ditto for a send on a
socket. But if the socket or pipe is full, then io_uring must wait for a
POLLOUT trigger to execute the request. This can be useful backpressure
information for an application. On the read side, it'll tell the
application whether data was readily available or not, if POLLIN
triggering was needed to read/recv the data.

This patchset adds support for IORING_CQE_F_POLLED, which is set in
cqe->flags if a request needed to go through the poll machinery before
it could get successfully executed.

Patch 1 is just an unrelated cleanup I spotted while doing this work.
Patch 2 adds a request flag that gets set via poll wake, and patch 3
wires up using this flag to set IORING_CQE_F_POLLED.

liburing test cases here:

https://git.kernel.dk/cgit/liburing/log/?h=cqe-polled

and the patches here can also be found here:

https://git.kernel.dk/cgit/linux/log/?h=io_uring-send-full

 include/linux/io_uring_types.h |  3 +++
 include/uapi/linux/io_uring.h  |  6 ++++++
 io_uring/io_uring.c            | 14 ++++++--------
 io_uring/io_uring.h            |  2 ++
 io_uring/poll.c                |  1 +
 5 files changed, 18 insertions(+), 8 deletions(-)

-- 
Jens Axboe


       reply	other threads:[~2025-07-12  0:03 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <[PATCHSET 0/3] Add support for IORING_CQE_F_POLLED>
2025-07-11 23:59 ` Jens Axboe [this message]
2025-07-11 23:59   ` [PATCH 1/3] io_uring/poll: cleanup apoll freeing Jens Axboe
2025-07-11 23:59   ` [PATCH 2/3] io_uring/poll: flag request as having gone through poll wake machinery Jens Axboe
2025-07-12 11:39     ` Pavel Begunkov
2025-07-12 20:59       ` Jens Axboe
2025-07-14  9:26         ` Pavel Begunkov
2025-07-14 14:54           ` Jens Axboe
2025-07-14 15:45             ` Pavel Begunkov
2025-07-14 17:51               ` Jens Axboe
2025-07-18 10:20                 ` Pavel Begunkov
2025-07-11 23:59   ` [PATCH 3/3] io_uring: add IORING_CQE_F_POLLED flag Jens Axboe
2025-07-12 11:34     ` Pavel Begunkov
2025-07-12 14:49       ` Pavel Begunkov
2025-07-12 21:02         ` Jens Axboe
2025-07-12 23:05           ` Jens Axboe

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=20250712000344.1579663-1-axboe@kernel.dk \
    --to=axboe@kernel.dk \
    --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
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