History

io_uring: add support for linked SQE timeouts

While we have support for generic timeouts, we don't have a way to tie a timeout to a specific SQE. The generic timeouts simply trigger wakeups on the CQ ring. This adds support for IORING_OP_LINK_TIMEOUT. This command is only valid as a link to a previous command. The timeout specific can be either relative or absolute, following the same rules as IORING_OP_TIMEOUT. If the timeout triggers before the dependent command completes, it will attempt to cancel that command. Likewise, if the dependent command completes before the timeout triggers, it will cancel the timeout.

Jens Axboe committed 7 years ago

Commit 2665abf1 parent e977d6d2 files · +181 −11Browse files

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

Unified · Split

include/uapi/linux/io_uring.h+1−0
@@ -72,6 +72,7 @@ struct io_uring_sqe { · 71 unmodified lines
72#define IORING_OP_TIMEOUT_REMOVE 1272#define IORING_OP_TIMEOUT_REMOVE 12
73#define IORING_OP_ACCEPT 1373#define IORING_OP_ACCEPT 13
74#define IORING_OP_ASYNC_CANCEL 1474#define IORING_OP_ASYNC_CANCEL 14
75#define IORING_OP_LINK_TIMEOUT 15
75 76
76/*77/*
77 * sqe->fsync_flags78 * sqe->fsync_flags