io-uring.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCHSET v2 0/12] Move io_buffer_list out of struct io_kiocb
@ 2025-08-21  2:03 Jens Axboe
  2025-08-21  2:03 ` [PATCH 01/12] io_uring/kbuf: drop 'issue_flags' from io_put_kbuf(s)() arguments Jens Axboe
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: Jens Axboe @ 2025-08-21  2:03 UTC (permalink / raw)
  To: io-uring

Hi,

One thing that has annoyed me is that struct io_buffer_list is inside
struct io_kiocb, as they have potentially drastically different
lifetimes. This makes it easy to screw up, even if you think you know
what you are doing, as you need to understand the intricacies of
provided buffer ring lifetimes.

This patchset adds a struct io_br_sel, which is used for buffer
selection, and which also then stores the io_buffer_list whenever it
is safe to do so. io_br_sel resides on the stack of the user, and
hence cannot leak outside of that scope.

With this, we can also cleanup some of the random recycle points we
have in the code base in general.

Should not have any functional changes, unless I screwed up of course.
Passes full liburing tests as well.

Can also be found here:

https://git.kernel.dk/cgit/linux/log/?h=io_uring-buf-list

 include/linux/io_uring_types.h |   6 --
 io_uring/io_uring.c            |   4 +-
 io_uring/kbuf.c                |  67 ++++++++-------
 io_uring/kbuf.h                |  57 +++++++-----
 io_uring/net.c                 | 153 ++++++++++++++++-----------------
 io_uring/poll.c                |   4 -
 io_uring/rw.c                  |  56 ++++++------
 7 files changed, 177 insertions(+), 170 deletions(-)

Since v1:
- Drop 'issue_flags' from both io_put_kbuf() and io_put_kbufs(),
  unused in both.
- Add patch folding 'ret' in io_send_finish() with io_br_sel, just
  like was previously done on the receive side.
- Add patch checking for REQ_F_BUFFER_RING first in recycling.
- Rebase on current for-6.18/io_uring branch.

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2025-08-21  2:08 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-21  2:03 [PATCHSET v2 0/12] Move io_buffer_list out of struct io_kiocb Jens Axboe
2025-08-21  2:03 ` [PATCH 01/12] io_uring/kbuf: drop 'issue_flags' from io_put_kbuf(s)() arguments Jens Axboe
2025-08-21  2:03 ` [PATCH 02/12] io_uring/net: don't use io_net_kbuf_recyle() for non-provided cases Jens Axboe
2025-08-21  2:03 ` [PATCH 03/12] io_uring/net: clarify io_recv_buf_select() return value Jens Axboe
2025-08-21  2:03 ` [PATCH 04/12] io_uring/kbuf: pass in struct io_buffer_list to commit/recycle helpers Jens Axboe
2025-08-21  2:03 ` [PATCH 05/12] io_uring/kbuf: introduce struct io_br_sel Jens Axboe
2025-08-21  2:03 ` [PATCH 06/12] io_uring/rw: recycle buffers manually for non-mshot reads Jens Axboe
2025-08-21  2:03 ` [PATCH 07/12] io_uring/kbuf: use struct io_br_sel for multiple buffers picking Jens Axboe
2025-08-21  2:03 ` [PATCH 08/12] io_uring/net: use struct io_br_sel->val as the recv finish value Jens Axboe
2025-08-21  2:03 ` [PATCH 09/12] io_uring/net: use struct io_br_sel->val as the send " Jens Axboe
2025-08-21  2:03 ` [PATCH 10/12] io_uring/kbuf: switch to storing struct io_buffer_list locally Jens Axboe
2025-08-21  2:03 ` [PATCH 11/12] io_uring: remove async/poll related provided buffer recycles Jens Axboe
2025-08-21  2:03 ` [PATCH 12/12] io_uring/kbuf: check for ring provided buffers first in recycling Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).