Skip to content

Commit 2df6d89

Browse files
shirazsaleemjgunthorpe
authored andcommitted
RDMA/irdma: Reduce iWARP QP destroy time
QP destroy is synchronous and waits for its refcnt to be decremented in irdma_cm_node_free_cb (for iWARP) which fires after the RCU grace period elapses. Applications running a large number of connections are exposed to high wait times on destroy QP for events like SIGABORT. The long pole for this wait time is the firing of the call_rcu callback during a CM node destroy which can be slow. It holds the QP reference count and blocks the destroy QP from completing. call_rcu only needs to make sure that list walkers have a reference to the cm_node object before freeing it and thus need to wait for grace period elapse. The rest of the connection teardown in irdma_cm_node_free_cb is moved out of the grace period wait in irdma_destroy_connection. Also, replace call_rcu with a simple kfree_rcu as it just needs to do a kfree on the cm_node Fixes: 146b975 ("RDMA/irdma: Add connection manager") Link: https://lore.kernel.org/r/20220425181703.1634-3-shiraz.saleem@intel.com Signed-off-by: Shiraz Saleem <shiraz.saleem@intel.com> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
1 parent 7b8943b commit 2df6d89

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

  • drivers/infiniband/hw/irdma

drivers/infiniband/hw/irdma/cm.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2308,10 +2308,8 @@ irdma_make_cm_node(struct irdma_cm_core *cm_core, struct irdma_device *iwdev,
23082308
return NULL;
23092309
}
23102310

2311-
static void irdma_cm_node_free_cb(struct rcu_head *rcu_head)
2311+
static void irdma_destroy_connection(struct irdma_cm_node *cm_node)
23122312
{
2313-
struct irdma_cm_node *cm_node =
2314-
container_of(rcu_head, struct irdma_cm_node, rcu_head);
23152313
struct irdma_cm_core *cm_core = cm_node->cm_core;
23162314
struct irdma_qp *iwqp;
23172315
struct irdma_cm_info nfo;
@@ -2359,7 +2357,6 @@ static void irdma_cm_node_free_cb(struct rcu_head *rcu_head)
23592357
}
23602358

23612359
cm_core->cm_free_ah(cm_node);
2362-
kfree(cm_node);
23632360
}
23642361

23652362
/**
@@ -2387,8 +2384,9 @@ void irdma_rem_ref_cm_node(struct irdma_cm_node *cm_node)
23872384

23882385
spin_unlock_irqrestore(&cm_core->ht_lock, flags);
23892386

2390-
/* wait for all list walkers to exit their grace period */
2391-
call_rcu(&cm_node->rcu_head, irdma_cm_node_free_cb);
2387+
irdma_destroy_connection(cm_node);
2388+
2389+
kfree_rcu(cm_node, rcu_head);
23922390
}
23932391

23942392
/**

0 commit comments

Comments
 (0)