mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-02-17 09:00:22 -05:00
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>
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user