public inbox for io-uring@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/9] io_uring: add kernel-managed buffer rings
@ 2026-02-18  2:51 Joanne Koong
  2026-02-18  2:51 ` [PATCH v2 1/9] io_uring/memmap: chunk allocations in io_region_allocate_pages() Joanne Koong
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: Joanne Koong @ 2026-02-18  2:51 UTC (permalink / raw)
  To: axboe, io-uring; +Cc: csander, bernd, hch, asml.silence

Currently, io_uring buffer rings require the application to allocate and
manage the backing buffers. This series introduces buffer rings, where
the kernel allocates and manages the buffers on behalf of the application.

This is split out from the fuse over io_uring series in [1], which needs the
kernel to own and manage buffers shared between the fuse server and the
kernel.

This series is on top of commit 73cf88d775b1f55 in the for-next branch in
Jens' io-uring tree. The corresponding liburing changes are in [2] and will
be submitted after the changes in this patchset are accepted.

There was a discussion on v1 about having kernel-managed buffer rings go
through a user-provided registered memory region. This changes proposed in
this patchset add a simple straightforward interface where the kernel
allocates the buffers and the buffers are tied to the lifecycle of the ring,
which suffices for the majority of use cases. If/when in the future it is
useful for the buffers to be backed by a prior user registered mem region
(eg for PMD optimization gains), the changes in this patchset do not preclude
support for that from being added.

The link to the fuse commits that use the changes in this series is in [3].

Thanks,
Joanne

[1] https://lore.kernel.org/linux-fsdevel/20260116233044.1532965-1-joannelkoong@gmail.com/
[2] https://github.com/joannekoong/liburing/commits/pbuf_kernel_managed/
[3] https://github.com/joannekoong/linux/commits/fuse_zero_copy/

Changelog
---------
v1: https://lore.kernel.org/linux-fsdevel/20260210002852.1394504-1-joannelkoong@gmail.com/T/#t
* Incorporate Jens' feedback, including fixing wraparound int promotion bug
* memmap: drop allocation per buf + have everything go through io_create_region (Pavel),
  add 2MB chunking workaround for large allocations
* uapi: merge kmbuf into pbuf interface/apis as IOU_PBUF_RING_KERNEL_MANAGED flag (Pavel)

Changes since [1]:
* add "if (bl)" check for recycling API (Bernd)
* check mul overflow, use GFP_USER, use PTR as return type (Christoph)
* fix bl->ring leak (me)

Joanne Koong (9):
  io_uring/memmap: chunk allocations in io_region_allocate_pages()
  io_uring/kbuf: add support for kernel-managed buffer rings
  io_uring/kbuf: support kernel-managed buffer rings in buffer selection
  io_uring/kbuf: add buffer ring pinning/unpinning
  io_uring/kbuf: return buffer id in buffer selection
  io_uring/kbuf: add recycling for kernel managed buffer rings
  io_uring/kbuf: add io_uring_is_kmbuf_ring()
  io_uring/kbuf: export io_ring_buffer_select()
  io_uring/cmd: set selected buffer index in __io_uring_cmd_done()

 include/linux/io_uring/cmd.h   |  53 ++++++-
 include/linux/io_uring_types.h |  10 +-
 include/uapi/linux/io_uring.h  |  14 +-
 io_uring/kbuf.c                | 248 +++++++++++++++++++++++++++++----
 io_uring/kbuf.h                |  11 +-
 io_uring/memmap.c              |  87 +++++++++---
 io_uring/uring_cmd.c           |   6 +-
 7 files changed, 373 insertions(+), 56 deletions(-)

-- 
2.47.3


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

end of thread, other threads:[~2026-02-18  8:47 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-18  2:51 [PATCH v2 0/9] io_uring: add kernel-managed buffer rings Joanne Koong
2026-02-18  2:51 ` [PATCH v2 1/9] io_uring/memmap: chunk allocations in io_region_allocate_pages() Joanne Koong
2026-02-18  2:52 ` [PATCH v2 2/9] io_uring/kbuf: add support for kernel-managed buffer rings Joanne Koong
2026-02-18  2:52 ` [PATCH v2 3/9] io_uring/kbuf: support kernel-managed buffer rings in buffer selection Joanne Koong
2026-02-18  2:52 ` [PATCH v2 4/9] io_uring/kbuf: add buffer ring pinning/unpinning Joanne Koong
2026-02-18  2:52 ` [PATCH v2 5/9] io_uring/kbuf: return buffer id in buffer selection Joanne Koong
2026-02-18  2:52 ` [PATCH v2 6/9] io_uring/kbuf: add recycling for kernel managed buffer rings Joanne Koong
2026-02-18  2:52 ` [PATCH v2 7/9] io_uring/kbuf: add io_uring_is_kmbuf_ring() Joanne Koong
2026-02-18  2:52 ` [PATCH v2 8/9] io_uring/kbuf: export io_ring_buffer_select() Joanne Koong
2026-02-18  2:52 ` [PATCH v2 9/9] io_uring/cmd: set selected buffer index in __io_uring_cmd_done() Joanne Koong
2026-02-18  8:47 ` [syzbot ci] Re: io_uring: add kernel-managed buffer rings syzbot ci

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox