All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] tcm_loop: Drop host_lock around struct scsi_cmnd->scsi_done()
@ 2010-09-01 21:23 Nicholas A. Bellinger
  0 siblings, 0 replies; only message in thread
From: Nicholas A. Bellinger @ 2010-09-01 21:23 UTC (permalink / raw)
  To: linux-scsi, linux-kernel
  Cc: Mike Christie, Vasu Dev, Matthew Wilcox, Christoph Hellwig,
	FUJITA Tomonori, Hannes Reinecke, James Bottomley,
	Nicholas Bellinger

From: Nicholas Bellinger <nab@linux-iscsi.org>

Greetings all,

This patch updates tcm_loop_queue_data_in() and tcm_loop_queue_status()
to no longer hold struct Scsi_Host->host_lock while calling the
struct scsi_cmnd->scsi_done() callback, in order queue the *sc off into
the block softirq.  This optimization is safely allowed for SCSI LLDs on
modern v2.6 kernels, and is done by the majority of mainline SCSI LLDs.

Thanks to Vasu Dev to the clarification on this item!

Signed-off-by: Nicholas A. Bellinger <nab@linux-iscsi.org>
---
 drivers/target/tcm_loop/tcm_loop_fabric.c |    7 -------
 1 files changed, 0 insertions(+), 7 deletions(-)

diff --git a/drivers/target/tcm_loop/tcm_loop_fabric.c b/drivers/target/tcm_loop/tcm_loop_fabric.c
index 588730a..ef23f07 100644
--- a/drivers/target/tcm_loop/tcm_loop_fabric.c
+++ b/drivers/target/tcm_loop/tcm_loop_fabric.c
@@ -379,7 +379,6 @@ int tcm_loop_queue_data_in(struct se_cmd *se_cmd)
 	struct tcm_loop_cmd *tl_cmd =
 			(struct tcm_loop_cmd *)se_cmd->se_fabric_cmd_ptr;
 	struct scsi_cmnd *sc = tl_cmd->sc;
-	unsigned long flags;
 
 	TL_CDB_DEBUG( "tcm_loop_queue_data_in() called for scsi_cmnd: %p"
 			" cdb: 0x%02x\n", sc, sc->cmnd[0]);
@@ -393,10 +392,7 @@ int tcm_loop_queue_data_in(struct se_cmd *se_cmd)
 	}
 
 	sc->result = host_byte(DID_OK) | SAM_STAT_GOOD;
-
-	spin_lock_irqsave(sc->device->host->host_lock, flags);
 	(*sc->scsi_done)(sc);
-	spin_unlock_irqrestore(sc->device->host->host_lock, flags);
 	return 0;
 }
 
@@ -405,7 +401,6 @@ int tcm_loop_queue_status(struct se_cmd *se_cmd)
 	struct tcm_loop_cmd *tl_cmd =
 			(struct tcm_loop_cmd *)se_cmd->se_fabric_cmd_ptr;
 	struct scsi_cmnd *sc = tl_cmd->sc;
-	unsigned long flags;
 
 	TL_CDB_DEBUG("tcm_loop_queue_status() called for scsi_cmnd: %p"
 			" cdb: 0x%02x\n", sc, sc->cmnd[0]);
@@ -421,9 +416,7 @@ int tcm_loop_queue_status(struct se_cmd *se_cmd)
 	} else
 		sc->result = host_byte(DID_OK) | se_cmd->scsi_status;
 
-	spin_lock_irqsave(sc->device->host->host_lock, flags);
 	(*sc->scsi_done)(sc);
-	spin_unlock_irqrestore(sc->device->host->host_lock, flags);
 	return 0;
 }
 
-- 
1.5.6.5


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2010-09-01 21:23 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-01 21:23 [PATCH] tcm_loop: Drop host_lock around struct scsi_cmnd->scsi_done() Nicholas A. Bellinger

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.