summaryrefslogtreecommitdiff
path: root/io_uring/napi.h
diff options
context:
space:
mode:
authorOlivier Langlois <olivier@trillion01.com>2024-08-11 14:07:11 -0400
committerJens Axboe <axboe@kernel.dk>2024-08-12 12:09:03 -0600
commit84f2eecf95018386c145ada19bb45b03bdb80d9e (patch)
treeea68b33e4d44a82bed6dd67e86d41bce84894162 /io_uring/napi.h
parent8fe8ac24adcd76b12edbfdefa078567bfff117d4 (diff)
io_uring/napi: check napi_enabled in io_napi_add() before proceeding
doing so avoids the overhead of adding napi ids to all the rings that do not enable napi. if no id is added to napi_list because napi is disabled, __io_napi_busy_loop() will not be called. Signed-off-by: Olivier Langlois <olivier@trillion01.com> Fixes: b4ccc4dd1330 ("io_uring/napi: enable even with a timeout of 0") Link: https://lore.kernel.org/r/bd989ccef5fda14f5fd9888faf4fefcf66bd0369.1723400131.git.olivier@trillion01.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'io_uring/napi.h')
-rw-r--r--io_uring/napi.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/io_uring/napi.h b/io_uring/napi.h
index 88f1c21d5548..27b88c3eb428 100644
--- a/io_uring/napi.h
+++ b/io_uring/napi.h
@@ -55,7 +55,7 @@ static inline void io_napi_add(struct io_kiocb *req)
struct io_ring_ctx *ctx = req->ctx;
struct socket *sock;
- if (!READ_ONCE(ctx->napi_busy_poll_dt))
+ if (!READ_ONCE(ctx->napi_enabled))
return;
sock = sock_from_file(req->file);