Finally, the dead lock appears. CPU0 ---- lock(&xa->xa_lock#15); <----- rxe_alloc <Interrupt> lock(&xa->xa_lock#15); <---- rxe_pool_get_index *** DEADLOCK *** Fixes: 3225717f6dfa ("RDMA/rxe: Replace red-black trees by carrays") Reported-and-tested-by: Yi Zhang <yi.zhang@xxxxxxxxxx> Signed-off-by: Zhu Yanjun <yanjun.zhu@xxxxxxxxx> --- drivers/infiniband/sw/rxe/rxe_pool.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/infiniband/sw/rxe/rxe_pool.c b/drivers/infiniband/sw/rxe/rxe_pool.c index 67f1d4733682..7b12a52fed35 100644 --- a/drivers/infiniband/sw/rxe/rxe_pool.c +++ b/drivers/infiniband/sw/rxe/rxe_pool.c @@ -138,8 +138,8 @@ 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); + err = xa_alloc_cyclic_irq(&pool->xa, &elem->index, elem, pool->limit, + &pool->next, GFP_KERNEL); if (err) goto err_free; -- 2.27.0