From: Matthew Wilcox <matthew@wil.cx>
To: john smith <whalajam@yahoo.com>
Cc: linux-scsi@vger.kernel.org
Subject: Re: scsi_host_template.queuecommand() instances
Date: Sun, 27 Feb 2011 15:21:02 -0700 [thread overview]
Message-ID: <20110227222102.GH13726@parisc-linux.org> (raw)
In-Reply-To: <304254.22314.qm@web161906.mail.bf1.yahoo.com>
On Sun, Feb 27, 2011 at 11:22:06AM -0800, john smith wrote:
> I understand that inside LDD's scsi_host_template.queuecommand(), the card->spinlock can be used to protect shared data between concurrent instances of queuecommand and bottom-half/tasklets IO completion code.
> For SMP system with PCIE/MSIX enabled interrupts, there can be multiple instances of completion tasklets.
> The questions I have are:
>
> - can there be multiple instances of queuecommand as well?
Yes, queuecommand can be called on multiple CPUs simultaneously.
That's only been true since 2.6.37, though.
> - if so, I would assume they are IO commands issued for different targets (controlled by LDD), correct?
Not correct, they could easily be for the same LUN.
> Also, if true, these multiple instances must be running on different kernel threads spwaned by the SCSI mid layer, or block layer?
Linux doesn't use threads like this ... what usually happens is a
user thread makes a syscall (eg write() or read()) or faults on an
mmaped region. The thread switches into kernel mode, and winds its way
through the file system, into the page cache, then the block layer, down
to the scsi layer, and invokes queuecommand. Once queuecommand finishes,
the thread returns to the page cache to wait for the I/O to complete.
> Links to detailed and uptodate Block layer description would be appreciated (the ones I found are either old and superficial),
It's a lot of effort to keep these things up to date, and generally those
making the changes don't have the interest in updating documentation.
--
Matthew Wilcox Intel Open Source Technology Centre
"Bill, look, we understand that you're interested in selling us this
operating system, but compare it to ours. We can't possibly take such
a retrograde step."
next prev parent reply other threads:[~2011-02-27 22:21 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 [this message]
2011-02-28 7:21 ` john smith
2011-02-28 13:24 ` Matthew Wilcox
2011-02-28 14:14 ` James Bottomley
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=20110227222102.GH13726@parisc-linux.org \
--to=matthew@wil.cx \
--cc=linux-scsi@vger.kernel.org \
--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