]> git.baikalelectronics.ru Git - kernel.git/commit
io_uring: add timeout support for io_uring_enter()
authorHao Xu <haoxu@linux.alibaba.com>
Tue, 3 Nov 2020 02:54:37 +0000 (10:54 +0800)
committerJens Axboe <axboe@kernel.dk>
Wed, 9 Dec 2020 19:03:59 +0000 (12:03 -0700)
commit9f641f2f85a94cb3f3f9b0a592b10e78329f1327
treec36cd7f887cc1a711627b960fc7065a7eef8b995
parent46d470cc11190be71a5c47dbf1efcd14d83e61d9
io_uring: add timeout support for io_uring_enter()

Now users who want to get woken when waiting for events should submit a
timeout command first. It is not safe for applications that split SQ and
CQ handling between two threads, such as mysql. Users should synchronize
the two threads explicitly to protect SQ and that will impact the
performance.

This patch adds support for timeout to existing io_uring_enter(). To
avoid overloading arguments, it introduces a new parameter structure
which contains sigmask and timeout.

I have tested the workloads with one thread submiting nop requests
while the other reaping the cqe with timeout. It shows 1.8~2x faster
when the iodepth is 16.

Signed-off-by: Jiufei Xue <jiufei.xue@linux.alibaba.com>
Signed-off-by: Hao Xu <haoxu@linux.alibaba.com>
[axboe: various cleanups/fixes, and name change to SIG_IS_DATA]
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c
include/linux/syscalls.h
include/uapi/linux/io_uring.h