public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: James Bottomley <James.Bottomley@suse.de>
To: Matthew Wilcox <matthew@wil.cx>
Cc: john smith <whalajam@yahoo.com>, linux-scsi@vger.kernel.org
Subject: Re: scsi_host_template.queuecommand() instances
Date: Mon, 28 Feb 2011 08:14:39 -0600	[thread overview]
Message-ID: <1298902479.2487.9.camel@mulgrave.site> (raw)
In-Reply-To: <20110228132402.GI13726@parisc-linux.org>

On Mon, 2011-02-28 at 06:24 -0700, Matthew Wilcox wrote:
> On Sun, Feb 27, 2011 at 11:21:20PM -0800, john smith wrote:
> > How does the queuecommand get called for concurrent application threads  before 2.6.37?
> 
> Before 2.6.37, there's a per-host lock acquired in the scsi layer that
> prevents queuecommand being called twice for the same host simultaneously.
> If your driver is drivign two cards, then it can still be executing
> twice ...  but it's a rare driver that has global instead of per-host
> state to protect.

Actually, that's not quite correct.  What happened in 2.6.37 is that the
host lock was no longer taken prior to entry to ->queuecommand.  Before
that most of the threaded HBAs dropped it immediately in the
->queuecommand routines so they could be multi threaded, which meant all
we were doing a pointless lock shuffle.

What actually governs the threading is the ioscheduler entry context to
the request function, which tends to be governed by how the I/O is
called at the top.

James






  reply	other threads:[~2011-02-28 14:14 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-27 19:22 scsi_host_template.queuecommand() instances john smith
2011-02-27 22:21 ` Matthew Wilcox
2011-02-28  7:21   ` john smith
2011-02-28 13:24     ` Matthew Wilcox
2011-02-28 14:14       ` James Bottomley [this message]
2011-03-08 18:22         ` john smith
2011-03-04 20:58       ` john smith

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=1298902479.2487.9.camel@mulgrave.site \
    --to=james.bottomley@suse.de \
    --cc=linux-scsi@vger.kernel.org \
    --cc=matthew@wil.cx \
    --cc=whalajam@yahoo.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