Re: [PATCH v1 10/15] io_uring/zcrx: add io_zcrx_area

Pavel Begunkov
2024-10-09T19:05:04Z

On 10/9/24 19:02, Jens Axboe wrote:
> On 10/7/24 4:15 PM, David Wei wrote:
...
>> +struct io_zcrx_area {
>> + struct net_iov_area nia;
>> + struct io_zcrx_ifq *ifq;
>> +
>> + u16 area_id;
>> + struct page **pages;
>> +
>> + /* freelist */
>> + spinlock_t freelist_lock ____cacheline_aligned_in_smp;
>> + u32 free_count;
>> + u32 *freelist;
>> +};
>
> I'm wondering if this really needs an aligned lock? Since it's only a
> single structure, probably not a big deal. But unless there's evidence
> to the contrary, might not be a bad idea to just kill that.

napi and IORING_OP_RECV_ZC can run on different CPUs, I wouldn't
want the fields before the lock being contended by the lock
because of cache line sharing, would especially hurt until it's
warmed up well. Not really profiled, but not like we need to
care about space here.

--
Pavel Begunkov