Re: [PATCHv2 1/1] RDMA/rxe: Fix a dead lock problem

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

 



On Tue, Apr 12, 2022 at 09:43:28PM +0800, Yanjun Zhu wrote:
> 在 2022/4/11 19:50, Jason Gunthorpe 写道:
> > On Mon, Apr 11, 2022 at 04:00:18PM -0400, yanjun.zhu@xxxxxxxxx wrote:
> > > @@ -138,8 +139,10 @@ void *rxe_alloc(struct rxe_pool *pool)
> > >   	elem->obj = obj;
> > >   	kref_init(&elem->ref_cnt);
> > > -	err = xa_alloc_cyclic(&pool->xa, &elem->index, elem, pool->limit,
> > > -			      &pool->next, GFP_KERNEL);
> > > +	xa_lock_irqsave(&pool->xa, flags);
> > > +	err = __xa_alloc_cyclic(&pool->xa, &elem->index, elem, pool->limit,
> > > +				&pool->next, GFP_ATOMIC);
> > > +	xa_unlock_irqrestore(&pool->xa, flags);
> > 
> > No to  using atomics, this needs to be either the _irq or _bh varient
> 
> If I understand you correctly, you mean that we should use
> xa_lock_irq/xa_unlock_irq or xa_lock_bh/xa_unlock_bh instead of
> xa_unlock_irqrestore?

This is correct

> If so, xa_lock_irq/xa_unlock_irq or xa_lock_bh/xa_unlock_bh is used here,
> the warning as below will appear. This means that __rxe_add_to_pool disables
> softirq, but fpu_clone enables softirq.

I don't know what this is, you need to show the whole debug.

fpu_clone does not call rxe_add_to_pool
 
> As such, it is better to use xa_unlock_irqrestore +
> __xa_alloc(...,GFP_ATOMIC/GFP_NOWAIT).

No

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