OSDN Git Service

io_uring: add support for linked SQE timeouts
authorJens Axboe <axboe@kernel.dk>
Tue, 5 Nov 2019 19:40:47 +0000 (12:40 -0700)
committerJens Axboe <axboe@kernel.dk>
Fri, 8 Nov 2019 02:12:40 +0000 (19:12 -0700)
commit2665abfd757fb35a241c6f0b1ebf620e3ffb36fb
treec485fa90f65c90bbec24f90dcdfcf57d83327a69
parente977d6d34f0c08e3c3b132c9e73b98d0db50abc1
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.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c
include/uapi/linux/io_uring.h