From: Vasu Dev <vasu.dev@linux.intel.com>
To: "Nicholas A. Bellinger" <nab@linux-iscsi.org>
Cc: Christoph Hellwig <hch@infradead.org>,
James Bottomley <James.Bottomley@suse.de>,
Andi Kleen <ak@linux.intel.com>,
Tim Chen <tim.c.chen@linux.intel.com>,
Eric Moore <Eric.Moore@lsi.com>,
linux-scsi@vger.kernel.org, vasu.dev@intel.com,
willy@linux.intel.com
Subject: Re: [PATCH] scsi, mptsas : drop scsi_host lock when calling mptsas_qcmd
Date: Thu, 16 Sep 2010 18:12:40 -0700 [thread overview]
Message-ID: <1284685960.30345.70.camel@vi2.jf.intel.com> (raw)
In-Reply-To: <1284682425.13344.130.camel@haakon2.linux-iscsi.org>
On Thu, 2010-09-16 at 17:13 -0700, Nicholas A. Bellinger wrote:
> On Thu, 2010-09-16 at 19:25 -0400, Christoph Hellwig wrote:
> > On Thu, Sep 16, 2010 at 05:24:47PM -0400, James Bottomley wrote:
> > > > into the drivers (similar to how it has been done with the BKL).
> > > > This would be a fairly mechanic mindless patch. Lots of typing,
> > > > but not really a lot of real code review needed.
> > > >
> > > > Then next step the drivers who know they don't want it can remove it.
> > >
> > > Yes, that's basically what Christoph did when he moved the lock out of
> > > the eh path.
> >
> > And it is what we should do here as well. I'm just wondering if we rely
> > on the fact that we hold the lock over the check for the device beeing
> > deleted and the queuecommand call.
> >
>
> Ugh, I completely forgot the about the (host->shost_state == SHOST_DEL)
> check in scsi_dispatch_cmd() in patch #1, and just fixed this in
> lio-core-2.6.git/drop-host_lock here:
>
> http://git.kernel.org/?p=linux/kernel/git/nab/lio-core-2.6.git;a=commitdiff;h=e222907d9baac56425f87c602acdd757dc5fde08
>
> Here is what the updated scsi_dispatch_cmd() now looks like:
>
> <SNIP>
>
> spin_lock_irqsave(host->host_lock, flags);
> /*
> * AK: unlikely race here: for some reason the timer could
> * expire before the serial number is set up below.
> *
> * TODO: kill serial or move to blk layer
> */
> scsi_cmd_get_serial(host, cmd);
>
> if (unlikely(host->shost_state == SHOST_DEL)) {
> spin_unlock_irqrestore(host->host_lock, flags);
> cmd->result = (DID_NO_CONNECT << 16);
> scsi_done(cmd);
> } else {
> spin_unlock_irqrestore(host->host_lock, flags);
This unconditional drop will require LLD still using host lock for their
queuecommand to re-acquire the lock and that would hurt their perf as
Joe mentioned in his response. Also this change requires all such LLD to
grab and drop lock again and that change should go along with this
change.
BTW above change is very similar to patch under discussion, just off by
tiny additional check :-)
Vasu
> trace_scsi_dispatch_cmd_start(cmd);
> rtn = host->hostt->queuecommand(cmd, scsi_done);
> }
>
> <SNIP>
>
> Thanks!
>
> --nab
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2010-09-17 1:12 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-16 19:44 [PATCH] scsi, mptsas : drop scsi_host lock when calling mptsas_qcmd Tim Chen
2010-09-16 20:48 ` Nicholas A. Bellinger
2010-09-16 21:18 ` Tim Chen
2010-09-16 21:25 ` Andi Kleen
2010-09-16 21:24 ` James Bottomley
2010-09-16 23:25 ` Christoph Hellwig
2010-09-17 0:13 ` Nicholas A. Bellinger
2010-09-17 1:12 ` Vasu Dev [this message]
2010-09-16 21:34 ` Nicholas A. Bellinger
2010-09-16 21:44 ` Nicholas A. Bellinger
2010-09-16 21:48 ` Nicholas A. Bellinger
2010-09-16 22:00 ` Joe Eykholt
2010-09-16 22:16 ` James Bottomley
2010-09-17 7:16 ` Andi Kleen
2010-09-17 10:32 ` Bart Van Assche
2010-09-17 12:19 ` James Bottomley
2010-09-16 22:26 ` Tim Chen
2010-09-16 21:31 ` Vasu Dev
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=1284685960.30345.70.camel@vi2.jf.intel.com \
--to=vasu.dev@linux.intel.com \
--cc=Eric.Moore@lsi.com \
--cc=James.Bottomley@suse.de \
--cc=ak@linux.intel.com \
--cc=hch@infradead.org \
--cc=linux-scsi@vger.kernel.org \
--cc=nab@linux-iscsi.org \
--cc=tim.c.chen@linux.intel.com \
--cc=vasu.dev@intel.com \
--cc=willy@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