summaryrefslogtreecommitdiffstats
path: root/io_uring/sqpoll.c
diff options
context:
space:
mode:
authorStefan Roesch <shr@devkernel.io>2023-06-08 09:38:37 -0700
committerJens Axboe <axboe@kernel.dk>2024-02-09 11:54:28 -0700
commitff183d427da0a733b0dbe11bd7acaf2dcb37b4cc (patch)
tree608885d59ca17fa553a9a9c9edfae6776b63545b /io_uring/sqpoll.c
parent8d0c12a80cdeb80d5e0510e96d38fe551ed8e9b5 (diff)
downloadlinux-ff183d427da0a733b0dbe11bd7acaf2dcb37b4cc.tar.gz
linux-ff183d427da0a733b0dbe11bd7acaf2dcb37b4cc.tar.bz2
linux-ff183d427da0a733b0dbe11bd7acaf2dcb37b4cc.zip
io-uring: add sqpoll support for napi busy poll
This adds the sqpoll support to the io-uring napi. Signed-off-by: Stefan Roesch <shr@devkernel.io> Suggested-by: Olivier Langlois <olivier@trillion01.com> Link: https://lore.kernel.org/r/20230608163839.2891748-6-shr@devkernel.io Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'io_uring/sqpoll.c')
-rw-r--r--io_uring/sqpoll.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/io_uring/sqpoll.c b/io_uring/sqpoll.c
index 28bf0e085d31..f3979cacda13 100644
--- a/io_uring/sqpoll.c
+++ b/io_uring/sqpoll.c
@@ -15,6 +15,7 @@
#include <uapi/linux/io_uring.h>
#include "io_uring.h"
+#include "napi.h"
#include "sqpoll.h"
#define IORING_SQPOLL_CAP_ENTRIES_VALUE 8
@@ -194,6 +195,9 @@ static int __io_sq_thread(struct io_ring_ctx *ctx, bool cap_entries)
ret = io_submit_sqes(ctx, to_submit);
mutex_unlock(&ctx->uring_lock);
+ if (io_napi(ctx))
+ ret += io_napi_sqpoll_busy_poll(ctx);
+
if (to_submit && wq_has_sleeper(&ctx->sqo_sq_wait))
wake_up(&ctx->sqo_sq_wait);
if (creds)