lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <dafcf456-5153-49ea-91d8-a8242d3d4f13@gmail.com>
Date: Tue, 7 Jan 2025 00:04:49 +0000
From: Pavel Begunkov <asml.silence@...il.com>
To: Mina Almasry <almasrymina@...gle.com>, David Wei <dw@...idwei.uk>
Cc: io-uring@...r.kernel.org, netdev@...r.kernel.org,
 Jens Axboe <axboe@...nel.dk>, Jakub Kicinski <kuba@...nel.org>,
 Paolo Abeni <pabeni@...hat.com>, "David S. Miller" <davem@...emloft.net>,
 Eric Dumazet <edumazet@...gle.com>, Jesper Dangaard Brouer
 <hawk@...nel.org>, David Ahern <dsahern@...nel.org>,
 Stanislav Fomichev <stfomichev@...il.com>, Joe Damato <jdamato@...tly.com>,
 Pedro Tammela <pctammela@...atatu.com>
Subject: Re: [PATCH net-next v9 11/20] io_uring/zcrx: add io_zcrx_area

On 1/6/25 22:46, Mina Almasry wrote:
> On Tue, Dec 17, 2024 at 4:38 PM David Wei <dw@...idwei.uk> wrote:
>>
>> Add io_zcrx_area that represents a region of userspace memory that is
>> used for zero copy. During ifq registration, userspace passes in the
>> uaddr and len of userspace memory, which is then pinned by the kernel.
>> Each net_iov is mapped to one of these pages.
>>
>> The freelist is a spinlock protected list that keeps track of all the
>> net_iovs/pages that aren't used.
>>
> 
> FWIW we devmem uses genpool to manage the freelist and that lets us do
> allocations/free without locks. Not saying you should migrate to that
> but it's an option you have available.

It's not the hot path to care that much, but even then lockfree
is not always faster. It's naturally batched for allocations
while genpool does enough of work including at least a couple
of atomics.

-- 
Pavel Begunkov


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ