History

io_uring: add IORING_OP_WAITID support

This adds support for an async version of waitid(2), in a fully async version. If an event isn't immediately available, wait for a callback to trigger a retry. The format of the sqe is as follows: sqe->len The 'which', the idtype being queried/waited for. sqe->fd The 'pid' (or id) being waited for. sqe->file_index The 'options' being set. sqe->addr2 A pointer to siginfo_t, if any, being filled in. buf_index, add3, and waitid_flags are reserved/unused for now. waitid_flags will be used for options for this request type. One interesting use case may be to add multi-shot support, so that the request stays armed and posts a notification every time a monitored process state change occurs. Note that this does not support rusage, on Arnd's recommendation. See the waitid(2) man page for details on the arguments.

Jens Axboe committed 3 years ago

Commit f31ecf61 parent 2e521a28 files · +410 −1Browse files

Showing the changes to include/uapi (1 of 8 files). Show all

Unified · Split

include/uapi/linux/io_uring.h+2−0
@@ -65,6 +65,7 @@ struct io_uring_sqe { · 64 unmodified lines
65 __u32 xattr_flags;65 __u32 xattr_flags;
66 __u32 msg_ring_flags;66 __u32 msg_ring_flags;
67 __u32 uring_cmd_flags;67 __u32 uring_cmd_flags;
68 __u32 waitid_flags;
68 };69 };
69 __u64 user_data; /* data to be passed back at completion time */70 __u64 user_data; /* data to be passed back at completion time */
70 /* pack this to avoid bogus arm OABI complaints */71 /* pack this to avoid bogus arm OABI complaints */
@@ -241,6 +242,7 @@ enum io_uring_op { · 170 unmodified lines
241 IORING_OP_SEND_ZC,242 IORING_OP_SEND_ZC,
242 IORING_OP_SENDMSG_ZC,243 IORING_OP_SENDMSG_ZC,
243 IORING_OP_READ_MULTISHOT,244 IORING_OP_READ_MULTISHOT,
245 IORING_OP_WAITID,
244 246
245 /* this goes last, obviously */247 /* this goes last, obviously */
246 IORING_OP_LAST,248 IORING_OP_LAST,

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t