From: "Nicholas A. Bellinger" <nab@linux-iscsi.org>
To: linux-scsi <linux-scsi@vger.kernel.org>,
linux-kernel <linux-kernel@vger.kernel.org>
Cc: Mike Christie <michaelc@cs.wisc.edu>,
Vasu Dev <vasu.dev@linux.intel.com>,
Matthew Wilcox <matthew@wil.cx>, Christoph Hellwig <hch@lst.de>,
FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>,
Hannes Reinecke <hare@suse.de>,
James Bottomley <James.Bottomley@suse.de>,
Nicholas Bellinger <nab@linux-iscsi.org>
Subject: [PATCH] tcm_loop: Drop host_lock around struct scsi_cmnd->scsi_done()
Date: Wed, 1 Sep 2010 14:23:25 -0700 [thread overview]
Message-ID: <1283376205-8071-1-git-send-email-nab@linux-iscsi.org> (raw)
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
reply other threads:[~2010-09-01 21:23 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1283376205-8071-1-git-send-email-nab@linux-iscsi.org \
--to=nab@linux-iscsi.org \
--cc=James.Bottomley@suse.de \
--cc=fujita.tomonori@lab.ntt.co.jp \
--cc=hare@suse.de \
--cc=hch@lst.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=matthew@wil.cx \
--cc=michaelc@cs.wisc.edu \
--cc=vasu.dev@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).