Skip to content

Add io_uring support for waitid

Jens Axboe io-uring lkml 4 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest5 patches 4 repliesIn review
  2. v35 patches 0 repliesSuperseded
  3. v21 patch 0 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v15 patches15 repliesSuperseded

Changes in v4 from the cover letter

- Rebase on current tree
- Move it before the futex changes. Note that if you're testing this, this means that the opcode values have changed. The liburing repo has been rebased as a result as well, you'll want to update that too. liburing also has update test cases.
- Fix races between cancelation and wakeup trigger. This follows a scheme similar to the internal poll io_uring handling

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5exit: abstract out should_wake helper for child_wait_callback()kernel/exit.c+14 -60 replies
2/5exit: move core of do_wait() into helperkernel/exit.c+31 -200 replies
3/5exit: add kernel_waitid_prepare() helperkernel/exit.c+25 -130 replies
4/5exit: add internal include file with helperskernel/exit.c kernel/exit.h+37 -250 replies
5/5io_uring: add IORING_OP_WAITID supportinclude/linux/io_uring_types.h include/uapi/linux/io_uring.h io_uring/Makefile +5 more+410 -20 replies

Reviews trailers per patch

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

PatchChristian Brauner
1/5A-b
2/5A-b
3/5
4/5
5/5

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

Read the v4 thread

Cover letter [PATCHSET v4 0/5] Add io_uring support for waitid

Hi,

This adds support for IORING_OP_WAITID, which is an async variant of the waitid(2) syscall. Rather than have a parent need to block waiting on a child task state change, it can now simply get an async notication when the requested state change has occured.

Patches 1..4 are purely prep patches, and should not have functional changes. They split out parts of do_wait() into __do_wait(), so that the prepare-to-wait and sleep parts are contained within do_wait().

Patch 5 adds io_uring support.

I wrote a few basic tests for this, which can be found in the 'waitid' branch of liburing:

https://git.kernel.dk/cgit/liburing/log/?h=waitid

Also spun a custom kernel for someone to test it, and no issues reported so far.

The code can also be found here:

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

 include/linux/io_uring_types.h |   2 +
 include/uapi/linux/io_uring.h  |   2 +
 io_uring/Makefile              |   3 +-
 io_uring/cancel.c              |   5 +
 io_uring/io_uring.c            |   3 +
 io_uring/opdef.c               |  10 +-
 io_uring/waitid.c              | 372 +++++++++++++++++++++++++++++++++
 io_uring/waitid.h              |  15 ++
 kernel/exit.c                  | 131 ++++++------
 kernel/exit.h                  |  30 +++
 10 files changed, 512 insertions(+), 61 deletions(-)

Changes since v3:
- Rebase on current tree
- Move it before the futex changes. Note that if you're testing this, this means that the opcode values have changed. The liburing repo has been rebased as a result as well, you'll want to update that too. liburing also has update test cases.
- Fix races between cancelation and wakeup trigger. This follows a scheme similar to the internal poll io_uring handling

Signature · 1 line
Jens Axboe