On Thu, Jan 03, 2019 at 10:05:59AM +0200, Leon Romanovsky wrote: > From: Leon Romanovsky <leonro@xxxxxxxxxxxx> > > XArray uses internal lock for updates to XArray. This means that our > external RW lock is not needed anymore and we can delete it. The xarray lock only protects the array itself - not the things it points to. > - down_read(&res->rwsem); > xa_for_each(&res->xa[type], e, index, ULONG_MAX, XA_PRESENT) { > if (ns == &init_pid_ns || > (!rdma_is_kernel_res(e) && So eg here, 'e' is still needs the locking to protect against concurrent restrack_del causing e to be freed. Most likely the internal xarray locking doesn't save anything in this usage.. Jason