Skip to content

io_uring/uring_cmd: allow non-iopoll cmds with IORING_SETUP_IOPOLL

Caleb Sander Mateos io-uring linux-nvme lkml 5 versions – Applied

Status from this message: Applied, thanks!

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest5 patches 11 repliesApplied
  2. v45 patches 1 replySuperseded
  3. v34 patches 9 repliesSuperseded
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v24 patches4 repliesSuperseded
v13 patches2 repliesSuperseded

v2 from the cover letter

- Add REQ_F_IOPOLL request flag, remove redundant iopoll_queue
- Split IORING_OP_URING_CMD128 fix to a separate commit

Patches in v5 Applied

#Subject and filesSizeRepliesApplied
1/5io_uring: add REQ_F_IOPOLLinclude/linux/io_uring_types.h io_uring/io_uring.c io_uring/rw.c +1 more+16 -120 replies
2/5io_uring: remove iopoll_queue from struct io_issue_defio_uring/io_uring.c io_uring/opdef.c io_uring/opdef.h+1 -140 replies
3/5io_uring: count CQEs in io_iopoll_check()io_uring/io_uring.c+2 -77 replies
4/5io_uring/uring_cmd: allow non-iopoll cmds with IORING_SETUP_IOPOLLio_uring/uring_cmd.c+1 -30 replies
5/5nvme: remove nvme_dev_uring_cmd() IO_URING_F_IOPOLL checkdrivers/nvme/host/ioctl.c+0 -40 replies

Reviews trailers per patch

4 of 5 patches have a Reviewed-by or Acked-by.

PatchKanchan JoshiAnuj Gupta
1/5R-b R-b
2/5R-b R-b
3/5
4/5R-b R-b
5/5R-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v5 thread

Cover letter [PATCH v5 0/5] io_uring/uring_cmd: allow non-iopoll cmds with IORING_SETUP_IOPOLL

Currently, creating an io_uring with IORING_SETUP_IOPOLL requires all requests issued to it to support iopoll. This prevents, for example, using ublk zero-copy together with IORING_SETUP_IOPOLL, as ublk zero-copy buffer registrations are performed using a uring_cmd. There's no technical reason why these non-iopoll uring_cmds can't be supported. They will either complete synchronously or via an external mechanism that calls io_uring_cmd_done(), io_uring_cmd_post_mshot_cqe32(), or io_uring_mshot_cmd_post_cqe(), so they don't need to be polled.

Allow uring_cmd requests to be issued to IORING_SETUP_IOPOLL io_urings even if their files don't implement ->uring_cmd_iopoll().

Use a new REQ_F_IOPOLL flag to track whether a request is using iopoll. This makes the iopoll_queue opcode definition flag unnecessary.

The last commit removes an unnecessary IO_URING_F_IOPOLL check in nvme_dev_uring_cmd() as NVMe admin passthru commands can be issued to IORING_SETUP_IOPOLL io_urings now.

v5: perform one iteration of iopoll when min_events == 0 (Claude)

v4: check non-iopoll CQEs against min_events in io_iopoll_check() (Ming)

v3: fix REW -> REQ typo (Anuj)

v2:
- Add REQ_F_IOPOLL request flag, remove redundant iopoll_queue
- Split IORING_OP_URING_CMD128 fix to a separate commit

Caleb Sander Mateos (5):
io_uring: add REQ_F_IOPOLL
io_uring: remove iopoll_queue from struct io_issue_def
io_uring: count CQEs in io_iopoll_check() io_uring/uring_cmd: allow non-iopoll cmds with IORING_SETUP_IOPOLL
nvme: remove nvme_dev_uring_cmd() IO_URING_F_IOPOLL check

 drivers/nvme/host/ioctl.c      |  4 ----
 include/linux/io_uring_types.h |  3 +++
 io_uring/io_uring.c            | 19 ++++++-------------
 io_uring/opdef.c               | 10 ----------
 io_uring/opdef.h               |  2 --
 io_uring/rw.c                  | 11 ++++++-----
 io_uring/uring_cmd.c           |  9 ++++-----
 7 files changed, 19 insertions(+), 39 deletions(-)
Signature · 1 line
2.45.2