# Re: \[PATCH net-next 1/3\] net: netmem: add net\_iov\_area freelist helpers

- From: Pavel Begunkov \<asml.silence@gmail.com\>
- Date: 2026-09-24 15:41:25 
- List: netdev
- Page: https://ratatoskr.run/netdev/2026/09/17637175
- Thread: https://ratatoskr.run/netdev/2026/09/17624815/t.md

```text
On 9/24/26 16:02, Mina Almasry wrote:
> On Tue, Sep 22, 2026 at 1:43 PM Stanislav Fomichev [ref] wrote:
>>
>> io_uring zero-copy receive and devmem both maintain a bounded LIFO for
>> net_iovs in a contiguous area. Store the freelist in struct net_iov_area
>> and provide common push and pop helpers.
>>
>> Leave synchronization to area owners. Keep devmem's area adjacent to its
>
> This could be a follow up change, but I think synchronization should
> be provided by the netmem/niov infra, rather than the area owners. TBH
> the infra providing an unsynchronized data structure and letting the
> area owner use it and shoot themselves in the foot feels error prone.
> For now we could use a comment.

I don't think we want it. The duplication is minor, but I'm not set
on the per area index array approach, and it'd make changing it
more difficult.

> I also think we should not provide _push and_pop functions, rather we
> should provide _push_bulk() and _pop_bulk(), and the caller can decide
> to only push and pop 1 at a time if they need to. The reason is that
> in allocation paths, we almost always want to alloc in bulk. If the
> infra had the lock it could lock once and alloc a bulk.
-- 
Pavel Begunkov

```
