On Sun, Jun 21, 2020 at 01:41:10PM +0300, Leon Romanovsky wrote: > @@ -2318,19 +2313,18 @@ EXPORT_SYMBOL(ib_alloc_xrcd_user); > > int ib_dealloc_xrcd_user(struct ib_xrcd *xrcd, struct ib_udata *udata) > { > + unsigned long index; > struct ib_qp *qp; > int ret; > > if (atomic_read(&xrcd->usecnt)) > return -EBUSY; > > - while (!list_empty(&xrcd->tgt_qp_list)) { > - qp = list_entry(xrcd->tgt_qp_list.next, struct ib_qp, xrcd_list); > + xa_for_each(&xrcd->tgt_qps, index, qp) { > ret = ib_destroy_qp(qp); > if (ret) > return ret; > } Why doesn't this need to hold the tgt_qps_rwsem? Jason