currently iser recv completion flow takes the session lock twice.
optimize it to avoid the first one by letting iser_task_rdma_finalize()
be called only from the cleanup_task callback invoked by iscsi_free_task,
thus reducing the contention on the session lock between the scsi
command submission to the scsi command completion flows.

Signed-off-by: Or Gerlitz <ogerl...@voltaire.com>
Reviewed-by: Mike Christie <micha...@cs.wisc.edu>

---

resending with a fixed subject line which contains the "ib/iser:" prefix

 drivers/infiniband/ulp/iser/iser_initiator.c |   25 -------------------------
 1 file changed, 25 deletions(-)

Index: linux-2.6.33-rc7/drivers/infiniband/ulp/iser/iser_initiator.c
===================================================================
--- linux-2.6.33-rc7.orig/drivers/infiniband/ulp/iser/iser_initiator.c
+++ linux-2.6.33-rc7/drivers/infiniband/ulp/iser/iser_initiator.c
@@ -440,10 +440,7 @@ void iser_rcv_completion(struct iser_rx_
                         struct iser_conn *ib_conn)
 {
        struct iscsi_iser_conn *conn = ib_conn->iser_conn;
-       struct iscsi_task *task;
-       struct iscsi_iser_task *iser_task;
        struct iscsi_hdr *hdr;
-       unsigned char opcode;
        u64 rx_dma;
        int rx_buflen, outstanding, count, err;

@@ -464,28 +461,6 @@ void iser_rcv_completion(struct iser_rx_
        iser_dbg("op 0x%x itt 0x%x dlen %d\n", hdr->opcode,
                        hdr->itt, (int)(rx_xfer_len - ISER_HEADERS_LEN));

-       opcode = hdr->opcode & ISCSI_OPCODE_MASK;
-
-       if (opcode == ISCSI_OP_SCSI_CMD_RSP) {
-               spin_lock(&conn->iscsi_conn->session->lock);
-               task = iscsi_itt_to_ctask(conn->iscsi_conn, hdr->itt);
-               if (task)
-                       __iscsi_get_task(task);
-               spin_unlock(&conn->iscsi_conn->session->lock);
-
-               if (!task)
-                       iser_err("itt can't be matched to task!!! "
-                                "conn %p opcode %d itt %d\n",
-                                conn->iscsi_conn, opcode, hdr->itt);
-               else {
-                       iser_task = task->dd_data;
-                       iser_dbg("itt %d task %p\n",hdr->itt, task);
-                       iser_task->status = ISER_TASK_STATUS_COMPLETED;
-                       iser_task_rdma_finalize(iser_task);
-                       iscsi_put_task(task);
-               }
-       }
-
        iscsi_iser_recv(conn->iscsi_conn, hdr,
                rx_desc->data, rx_xfer_len - ISER_HEADERS_LEN);

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to