On 02/03/2010 03:09 AM, Or Gerlitz wrote:

[PATCH RFC] remove some of the locking in iser scsi command response flow

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.

Doh forgot about the original issue. Nice idea and patch. Looks ok to me.

Reviewed-by: Mike Christie <micha...@cs.wisc.edu>


Signed-off-by: Or Gerlitz<ogerl...@voltaire.com>

-----

Index: linux-2.6/drivers/infiniband/ulp/iser/iser_initiator.c
===================================================================
--- linux-2.6.orig/drivers/infiniband/ulp/iser/iser_initiator.c
+++ linux-2.6/drivers/infiniband/ulp/iser/iser_initiator.c
@@ -571,8 +571,6 @@ void iser_rcv_completion(struct iser_des
  {
        struct iser_dto *dto =&rx_desc->dto;
        struct iscsi_iser_conn *conn = dto->ib_conn->iser_conn;
-       struct iscsi_task *task;
-       struct iscsi_iser_task *iser_task;
        struct iscsi_hdr *hdr;
        char   *rx_data = NULL;
        int     rx_data_len = 0;
@@ -590,25 +588,6 @@ void iser_rcv_completion(struct iser_des

        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);
-               }
-       }
        iser_dto_buffs_release(dto);

        iscsi_iser_recv(conn->iscsi_conn, hdr, rx_data, rx_data_len);


--
You received this message because you are subscribed to the Google Groups 
"open-iscsi" group.
To post to this group, send email to open-is...@googlegroups.com.
To unsubscribe from this group, send email to 
open-iscsi+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/open-iscsi?hl=en.

Reply via email to