All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pavel Begunkov <asml.silence@gmail.com>
To: Jens Axboe <axboe@kernel.dk>, io-uring@vger.kernel.org
Subject: Re: [PATCH 0/4] implement vectored registered buffers for sendzc
Date: Thu, 24 Oct 2024 16:29:08 +0100	[thread overview]
Message-ID: <bfbe577b-1092-47a2-ab6c-d358f55003dc@gmail.com> (raw)
In-Reply-To: <b15e136f-3dbd-4d4e-92c5-103ecffe3965@kernel.dk>

On 10/23/24 14:52, Jens Axboe wrote:
> On 10/22/24 8:38 PM, Pavel Begunkov wrote:
>> Allow registered buffers to be used with zerocopy sendmsg, where the
>> passed iovec becomes a scatter list into the registered buffer
>> specified by sqe->buf_index. See patches 3 and 4 for more details.
>>
>> To get performance out of it, it'll need a bit more work on top for
>> optimising allocations and cleaning up send setups. We can also
>> implement it for non zerocopy variants and reads/writes in the future.
>>
>> Tested by enabling it in test/send-zerocopy.c, which checks payloads,
>> and exercises lots of corner cases, especially around send sizes,
>> offsets and non aligned registered buffers.
> 
> Just for the edification of the list readers, Pavel and I discussed this
> a bit last night. There's a decent amount of overlap with the send zc
> provided + registered buffers work that I did last week, but haven't
> posted yet. It's here;
> 
> https://git.kernel.dk/cgit/linux/log/?h=io_uring-sendzc-provided
> 
> in terms of needing and using both bvec and iovec in the array, and
> having the suitable caching for the arrays rather than needing a full
> alloc + free every time.

And as I mentioned, that can be well done in-place (in the same
array) as one option.

> The send zc part can map into bvecs upfront and hence don't need the
> iovec array storage at the same time, which this one does as the sendmsg
> zc opcode needs to import an iovec. But perhaps there's a way to still
> unify the storage and retain the caching, without needing to come up
> with something new.

I looked through. The first problem is that your thing consuming
entries from the ring, with iovecs it'd need to be reading it
from the user one by one. Considering allocations in your helpers,
that would turn it into a bunch of copy_from_user, and it might
just easier and cleaner to copy the entire iovec.

And you just made one towards delaying the imu resolution, which
is conceptually the right thing to do because of the mess with
links, just like it is with fixed files. That's why it need to
copy the iovec at the prep stage and resolve at the issue time.

> Just a brief summary of the out-of-band discussion.

-- 
Pavel Begunkov

  reply	other threads:[~2024-10-24 15:28 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-23  2:38 [PATCH 0/4] implement vectored registered buffers for sendzc Pavel Begunkov
2024-10-23  2:38 ` [PATCH 1/4] io_uring/net: introduce io_kmsg_set_iovec Pavel Begunkov
2024-10-23  2:38 ` [PATCH 2/4] io_uring/net: allow mixed bvec/iovec caching Pavel Begunkov
2024-10-23  2:38 ` [PATCH 3/4] io_uring: vectored registered buffer import Pavel Begunkov
2024-10-23  2:38 ` [PATCH 4/4] io_uring/net: sendzc with vectored fixed buffers Pavel Begunkov
2024-10-23 13:52 ` [PATCH 0/4] implement vectored registered buffers for sendzc Jens Axboe
2024-10-24 15:29   ` Pavel Begunkov [this message]
2024-10-24 15:45     ` Jens Axboe
2024-10-24 16:06       ` Pavel Begunkov
2024-10-24 17:19         ` Jens Axboe
2024-10-24 17:56           ` Pavel Begunkov
2024-10-24 18:00             ` Jens Axboe
2024-10-24 18:13               ` Pavel Begunkov
2024-10-24 19:56                 ` Jens Axboe
2024-10-24 22:14                   ` Pavel Begunkov
2024-10-24 22:22                     ` Jens Axboe
2024-10-24 22:51                       ` Pavel Begunkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bfbe577b-1092-47a2-ab6c-d358f55003dc@gmail.com \
    --to=asml.silence@gmail.com \
    --cc=axboe@kernel.dk \
    --cc=io-uring@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.