Re: [PATCH rdma-next 2/2] RDMA/core: Optimize XRC target lookup

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

 



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



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux