From: Jens Axboe Date: Mon, 21 Feb 2022 16:43:48 +0000 (-0700) Subject: io_uring: use syscall helpers for the hot path X-Git-Tag: fio-3.30~32 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=c377f4f85943e5b155b3daaab1ce5213077531d8;p=fio.git io_uring: use syscall helpers for the hot path 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 --- diff --git a/engines/io_uring.c b/engines/io_uring.c index a2533c88..1e15647e 100644 --- a/engines/io_uring.c +++ b/engines/io_uring.c @@ -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) diff --git a/t/io_uring.c b/t/io_uring.c index f513d7dc..b8fcffe8 100644 --- a/t/io_uring.c +++ b/t/io_uring.c @@ -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