Re: [PATCH 1/2] IB/cm: Fix sleeping in atomic when RoCE is used

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

 



On 8/29/2017 1:34 PM, Roland Dreier wrote:
> From: Roland Dreier <roland@xxxxxxxxxxxxxxx>
> 
> A couple of places in the CM do
> 
>     spin_lock_irq(&cm_id_priv->lock);
>     ...
>     if (cm_alloc_response_msg(work->port, work->mad_recv_wc, &msg))
> 
> However when the underlying transport is RoCE, this leads to a sleeping function
> being called with the lock held - the callchain is
> 
>     cm_alloc_response_msg() ->
>       ib_create_ah_from_wc() ->
>         ib_init_ah_from_wc() ->
>           rdma_addr_find_l2_eth_by_grh() ->
>             rdma_resolve_ip()
> 
> and rdma_resolve_ip() starts out by doing
> 
>     req = kzalloc(sizeof *req, GFP_KERNEL);
> 
> not to mention rdma_addr_find_l2_eth_by_grh() doing
> 
>     wait_for_completion(&ctx.comp);
> 
> to wait for the task that rdma_resolve_ip() queues up.
> 
> Fix this by moving the AH creation out of the lock.
> 
> Signed-off-by: Roland Dreier <roland@xxxxxxxxxxxxxxx>

This looks good Roland, thanks for that.  Will apply today.

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

Attachment: signature.asc
Description: OpenPGP digital signature


[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