From: David Wei <dw@davidwei.uk>
To: Pavel Begunkov <asml.silence@gmail.com>,
io-uring@vger.kernel.org, netdev@vger.kernel.org
Cc: Jens Axboe <axboe@kernel.dk>
Subject: Re: [PATCH v6 0/5] io_uring zcrx ifq sharing
Date: Tue, 11 Nov 2025 09:35:07 -0800 [thread overview]
Message-ID: <17aaebdb-aee4-4a00-926b-847943aea14c@davidwei.uk> (raw)
In-Reply-To: <f933fe15-6bd5-4acc-94ce-d5ce498ecf79@gmail.com>
On 2025-11-11 06:40, Pavel Begunkov wrote:
> On 11/8/25 18:14, David Wei wrote:
>> Each ifq is bound to a HW RX queue with no way to share this across
>> multiple rings. It is possible that one ring will not be able to fully
>> saturate an entire HW RX queue due to userspace work. There are two ways
>> to handle more work:
>>
>> 1. Move work to other threads, but have to pay context switch overhead
>> and cold caches.
>> 2. Add more rings with ifqs, but HW RX queues are a limited resource.
>>
>> This patchset add a way for multiple rings to share the same underlying
>> src ifq that is bound to a HW RX queue. Rings with shared ifqs can issue
>> io_recvzc on zero copy sockets, just like the src ring.
>>
>> Userspace are expected to create rings in separate threads and not
>> processes, such that all rings share the same address space. This is
>> because the sharing and synchronisation of refill rings is purely done
>> in userspace with no kernel involvement e.g. dst rings do not mmap the
>> refill ring. Also, userspace must distribute zero copy sockets steered
>> into the same HW RX queue across rings sharing the ifq.
>
> I agree it's the simplest way to use it, but cross process sharing
> is a valid use case. I'm sure you can mmap it by guessing offset
> and you can place it into some shared memory otherwise.
>
> The implementation lgtm. I need to give it a run, but let me
> queue it up with other dependencies.
>
Yeah there's no reason why shm + mmap wouldn't work cross process with
the right offsets, but I do suspect that it'll be niche with most users
running iou across threads in the same process.
We can add cross process support in the future.
prev parent reply other threads:[~2025-11-11 17:35 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-08 18:14 [PATCH v6 0/5] io_uring zcrx ifq sharing David Wei
2025-11-08 18:14 ` [PATCH v6 1/5] io_uring/zcrx: count zcrx users David Wei
2025-11-08 18:14 ` [PATCH v6 2/5] io_uring/zcrx: move io_zcrx_scrub() and dependencies up David Wei
2025-11-08 18:14 ` [PATCH v6 3/5] io_uring/zcrx: export zcrx via a file David Wei
2025-11-08 18:14 ` [PATCH v6 4/5] io_uring/zcrx: add io_fill_zcrx_offsets() David Wei
2025-11-08 18:14 ` [PATCH v6 5/5] io_uring/zcrx: share an ifq between rings David Wei
2025-11-11 14:40 ` [PATCH v6 0/5] io_uring zcrx ifq sharing Pavel Begunkov
2025-11-11 17:35 ` David Wei [this message]
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=17aaebdb-aee4-4a00-926b-847943aea14c@davidwei.uk \
--to=dw@davidwei.uk \
--cc=asml.silence@gmail.com \
--cc=axboe@kernel.dk \
--cc=io-uring@vger.kernel.org \
--cc=netdev@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 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).