summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2025-08-20 20:03:41 -0600
committerJens Axboe <axboe@kernel.dk>2025-08-24 11:41:12 -0600
commitfe524b06843c19cf8d0025b644d56c4c31e60bc9 (patch)
tree1d226593f38e611b390c19720db8198aaa2f04ee
parente973837b54024f070b2b48c7ee9725548548257a (diff)
io_uring/kbuf: check for ring provided buffers first in recycling
This is the most likely of paths if a provided buffer is used, so offer it up first and push the legacy buffers to later. Link: https://lore.kernel.org/r/20250821020750.598432-14-axboe@kernel.dk Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r--io_uring/kbuf.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/io_uring/kbuf.h b/io_uring/kbuf.h
index 1a539969fc9c..32f73adbe1e9 100644
--- a/io_uring/kbuf.h
+++ b/io_uring/kbuf.h
@@ -129,10 +129,10 @@ static inline bool io_kbuf_recycle(struct io_kiocb *req, struct io_buffer_list *
{
if (req->flags & REQ_F_BL_NO_RECYCLE)
return false;
- if (req->flags & REQ_F_BUFFER_SELECTED)
- return io_kbuf_recycle_legacy(req, issue_flags);
if (req->flags & REQ_F_BUFFER_RING)
return io_kbuf_recycle_ring(req, bl);
+ if (req->flags & REQ_F_BUFFER_SELECTED)
+ return io_kbuf_recycle_legacy(req, issue_flags);
return false;
}