On 3/4/25 12:12, Stefan Metzmacher wrote:
Hi Pavel,
Add registered buffer support for vectored io_uring operations. That
allows to pass an iovec, all entries of which must belong to and
point into the same registered buffer specified by sqe->buf_index.
The series covers zerocopy sendmsg and reads / writes. Reads and
writes are implemented as new opcodes, while zerocopy sendmsg
reuses IORING_RECVSEND_FIXED_BUF for the api.
Results are aligned to what one would expect from registered buffers:
t/io_uring + nullblk, single segment 16K:
34 -> 46 GiB/s
examples/send-zerocopy.c default send size (64KB):
82558 -> 123855 MB/s
Thanks for implementing this, it's great to be able to combine these 2
optimizations! Though I suspect many applications will want to perform
vectorized I/O using iovecs that come from different registered
buffers (e.g. separate header and data allocations). Perhaps a future
improvement could allow a list of buffer indices to be specified.
I'm wondering about the same. And it's not completely
clear to me what the value of iov_base is in this case,
is it the offset into the buffer, or the real pointer address
that must within the range of the registered buffer?
Same as with other registered buffer requests. It's a pointer into
the initial buffer you specified when registering it, which serves
to calculate the offset.
See the io_uring_register(2) man, addr and len are iov_base and
iov_len and there are multiple of them. You can call it confusing,
and I'd agree, but that's how it was done from the very beginning,
so staying consistent here.
https://github.com/axboe/liburing/blob/master/man/io_uring_register.2#L87
It might also be very useful to have some vector elements pointing
into one of the registered buffer, while others refer to non-registered
buffers.
See the other reply.
--
Pavel Begunkov