[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [PATCH v2 2/5] nbd: replace socks pointer array with xarray





在 2026/7/5 18:02, yu kuai 写道:
Hi,

在 2026/6/25 16:44, Yang Erkun 写道:
Replace the krealloc-based struct nbd_sock **socks array with struct
xarray socks. Each nbd sock is fully initialized before being stored
into the xarray via xa_store(), ensuring concurrent readers calling
xa_load() never observe a partially initialized socket.

Convert all array index accesses to xa_load() and open-coded for-loops
to xa_for_each().

Signed-off-by: Long Li<leo.lilong@huawei.com>

xarray may not be good idea for IO hot path because of the overhead.

https://lore.kernel.org/all/60f9a88b-b750-3579-bdfd-5421f2040406@huaweicloud.com/


Hi,

Thanks for your review! Yeah, this may lead a little overhead for io hot path, I will try to find another way.

Thanks,
Erkun.


Reply to: