mbox series

[v3,0/6] regions, param pre-mapping and reg waits extension

Message ID cover.1731689588.git.asml.silence@gmail.com (mailing list archive)
Headers show
Series regions, param pre-mapping and reg waits extension | expand

Message

Pavel Begunkov Nov. 15, 2024, 4:54 p.m. UTC
A bit late but first we need a better and more generic API for
ring/memory/region registration (see Patch 4), and it changes the API
extending registered waits to be a generic parameter passing mechanism.
That will be useful in the future to implement a more flexible rings
creation, especially when we want to share same huge page / mapping.
Patch 6 uses it for registered wait arguments, and it can also be
used to optimise parameter passing for normal io_uring requests.

A dirty liburing branch with tests:

https://github.com/isilence/liburing/tree/io-uring-region-test

v3: fix page array memleak (Patch 4)

v2: cleaned up namings and commit messages
    moved all EXT_ARG_REG related bits Patch 5 -> 6
    added alignment checks (Patch 6)

Pavel Begunkov (6):
  io_uring: fortify io_pin_pages with a warning
  io_uring: disable ENTER_EXT_ARG_REG for IOPOLL
  io_uring: temporarily disable registered waits
  io_uring: introduce concept of memory regions
  io_uring: add memory region registration
  io_uring: restore back registered wait arguments

 include/linux/io_uring_types.h | 20 +++----
 include/uapi/linux/io_uring.h  | 28 +++++++++-
 io_uring/io_uring.c            | 27 +++++-----
 io_uring/memmap.c              | 69 ++++++++++++++++++++++++
 io_uring/memmap.h              | 14 +++++
 io_uring/register.c            | 97 ++++++++++++----------------------
 io_uring/register.h            |  1 -
 7 files changed, 166 insertions(+), 90 deletions(-)

Comments

Jens Axboe Nov. 15, 2024, 5:30 p.m. UTC | #1
On Fri, 15 Nov 2024 16:54:37 +0000, Pavel Begunkov wrote:
> A bit late but first we need a better and more generic API for
> ring/memory/region registration (see Patch 4), and it changes the API
> extending registered waits to be a generic parameter passing mechanism.
> That will be useful in the future to implement a more flexible rings
> creation, especially when we want to share same huge page / mapping.
> Patch 6 uses it for registered wait arguments, and it can also be
> used to optimise parameter passing for normal io_uring requests.
> 
> [...]

Applied, thanks!

[1/6] io_uring: fortify io_pin_pages with a warning
      (no commit info)
[2/6] io_uring: disable ENTER_EXT_ARG_REG for IOPOLL
      (no commit info)
[3/6] io_uring: temporarily disable registered waits
      (no commit info)
[4/6] io_uring: introduce concept of memory regions
      (no commit info)
[5/6] io_uring: add memory region registration
      (no commit info)
[6/6] io_uring: restore back registered wait arguments
      (no commit info)

Best regards,
Jens Axboe Nov. 15, 2024, 5:31 p.m. UTC | #2
On 11/15/24 10:30 AM, Jens Axboe wrote:
> 
> On Fri, 15 Nov 2024 16:54:37 +0000, Pavel Begunkov wrote:
>> A bit late but first we need a better and more generic API for
>> ring/memory/region registration (see Patch 4), and it changes the API
>> extending registered waits to be a generic parameter passing mechanism.
>> That will be useful in the future to implement a more flexible rings
>> creation, especially when we want to share same huge page / mapping.
>> Patch 6 uses it for registered wait arguments, and it can also be
>> used to optimise parameter passing for normal io_uring requests.
>>
>> [...]
> 
> Applied, thanks!
> 
> [1/6] io_uring: fortify io_pin_pages with a warning
>       (no commit info)
> [2/6] io_uring: disable ENTER_EXT_ARG_REG for IOPOLL
>       (no commit info)
> [3/6] io_uring: temporarily disable registered waits
>       (no commit info)
> [4/6] io_uring: introduce concept of memory regions
>       (no commit info)
> [5/6] io_uring: add memory region registration
>       (no commit info)
> [6/6] io_uring: restore back registered wait arguments
>       (no commit info)

Manual followup - normally I would've let this simmer until the next
version, but it is kind of silly to introduce fixed waits and then be
stuck with that implementation for eternity when we could be using the
generic infrastructure. Hence why it's added at this point for 6.13.

Caveat - this will break the existing registered cqwait in liburing,
but there's time to get that sorted before the next liburing release.