Re: [PATCH for-next 14/17] IB/hfi1: Integrate TID RDMA READ protocol into RC protocol

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

 



On Wed, 2019-01-23 at 19:32 -0800, Dennis Dalessandro wrote:
> +error_qp:
> +       spin_unlock_irqrestore(&qp->s_lock, ps->flags);
> +       spin_lock_irqsave(&qp->r_lock, ps->flags);
> +       spin_lock(&qp->s_lock);
> +       rvt_error_qp(qp, IB_WC_WR_FLUSH_ERR);
> +       spin_unlock(&qp->s_lock);
> +       spin_unlock_irqrestore(&qp->r_lock, ps->flags);
> +       spin_lock_irqsave(&qp->s_lock, ps->flags);

That's just ugly.  I get that you have lock ordering that you have to
obey, but have you considered doing a spin_trylock and only doing the
unwind/rewind if it fails?  It might not matter much here on the QP
error path, but if you have this same unwind/rewind elsewhere in the
driver in what amounts to more of a hot path...

-- 
Doug Ledford <dledford@xxxxxxxxxx>
    GPG KeyID: B826A3330E572FDD
    Key fingerprint = AE6B 1BDA 122B 23B4 265B  1274 B826 A333 0E57 2FDD

Attachment: signature.asc
Description: This is a digitally signed message part


[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