From: Ankit Kumar Date: Tue, 11 Oct 2022 10:59:35 +0000 (+0530) Subject: engines/io_uring: set coop taskrun, single issuer and defer taskrun X-Git-Tag: fio-3.33~18 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=07f78c37833730594778fb5684ac6ec40d0289f8;p=fio.git engines/io_uring: set coop taskrun, single issuer and defer taskrun Add missing changes to io_uring_cmd I/O engine for COOP_TASKRUN This was introduced for io_uring in commit 4d22c103 Add missing changes to io_uring_cmd I/O engine to set single issuer and defer taskrun. This was introduced for io_uring in commit e453f369 Signed-off-by: Ankit Kumar Link: https://lore.kernel.org/r/20221011105935.10455-2-ankit.kumar@samsung.com Signed-off-by: Jens Axboe --- diff --git a/engines/io_uring.c b/engines/io_uring.c index c679177f..6906e0a4 100644 --- a/engines/io_uring.c +++ b/engines/io_uring.c @@ -889,9 +889,30 @@ static int fio_ioring_cmd_queue_init(struct thread_data *td) p.flags |= IORING_SETUP_CQSIZE; p.cq_entries = depth; + /* + * Setup COOP_TASKRUN as we don't need to get IPI interrupted for + * completing IO operations. + */ + p.flags |= IORING_SETUP_COOP_TASKRUN; + + /* + * io_uring is always a single issuer, and we can defer task_work + * runs until we reap events. + */ + p.flags |= IORING_SETUP_SINGLE_ISSUER | IORING_SETUP_DEFER_TASKRUN; + retry: ret = syscall(__NR_io_uring_setup, depth, &p); if (ret < 0) { + if (errno == EINVAL && p.flags & IORING_SETUP_DEFER_TASKRUN) { + p.flags &= ~IORING_SETUP_DEFER_TASKRUN; + p.flags &= ~IORING_SETUP_SINGLE_ISSUER; + goto retry; + } + if (errno == EINVAL && p.flags & IORING_SETUP_COOP_TASKRUN) { + p.flags &= ~IORING_SETUP_COOP_TASKRUN; + goto retry; + } if (errno == EINVAL && p.flags & IORING_SETUP_CQSIZE) { p.flags &= ~IORING_SETUP_CQSIZE; goto retry;