io_uring: use syscall helpers for the hot path
authorJens Axboe <axboe@kernel.dk>
Mon, 21 Feb 2022 16:43:48 +0000 (09:43 -0700)
committerJens Axboe <axboe@kernel.dk>
Mon, 21 Feb 2022 16:43:48 +0000 (09:43 -0700)
The only real hot system call here is the io_uring_enter(2) call,
as that'll happen during the IO submission/completion parts. The rest
are just setup function calls, we don't really care about those.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
engines/io_uring.c
t/io_uring.c

index a2533c88e6a2c0bfa819dd782e37888f6f0bc960..1e15647ede45210a5090fca2eb10e923261f6dd5 100644 (file)
@@ -278,8 +278,13 @@ static struct fio_option options[] = {
 static int io_uring_enter(struct ioring_data *ld, unsigned int to_submit,
                         unsigned int min_complete, unsigned int flags)
 {
+#ifdef FIO_ARCH_HAS_SYSCALL
+       return __do_syscall6(__NR_io_uring_enter, ld->ring_fd, to_submit,
+                               min_complete, flags, NULL, 0);
+#else
        return syscall(__NR_io_uring_enter, ld->ring_fd, to_submit,
                        min_complete, flags, NULL, 0);
+#endif
 }
 
 static int fio_ioring_prep(struct thread_data *td, struct io_u *io_u)
index f513d7dcd8aa81cdb4c46bf841889b8a6846d583..b8fcffe88cdb151cb2cec9dd8e40a45da7b55097 100644 (file)
@@ -422,8 +422,13 @@ out:
 static int io_uring_enter(struct submitter *s, unsigned int to_submit,
                          unsigned int min_complete, unsigned int flags)
 {
+#ifdef FIO_ARCH_HAS_SYSCALL
+       return __do_syscall6(__NR_io_uring_enter, s->ring_fd, to_submit,
+                               min_complete, flags, NULL, 0);
+#else
        return syscall(__NR_io_uring_enter, s->ring_fd, to_submit, min_complete,
                        flags, NULL, 0);
+#endif
 }
 
 #ifndef CONFIG_HAVE_GETTID