public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Douglas Gilbert <dougg@torque.net>
To: James Bottomley <James.Bottomley@SteelEye.com>
Cc: Liran Schour <LIRANS@il.ibm.com>,
	SCSI Mailing List <linux-scsi@vger.kernel.org>
Subject: Re: SCSI commands order when using scsi_do_req
Date: Fri, 03 Jun 2005 10:03:04 +1000	[thread overview]
Message-ID: <429F9E38.4070700@torque.net> (raw)
In-Reply-To: <1117734886.5025.55.camel@mulgrave>

James Bottomley wrote:
> On Thu, 2005-06-02 at 20:31 +0300, Liran Schour wrote:
> 
>>I am developing a new SCSI upper layer driver. (Object based SCSI device)
>>I noticed that scsi_do_req execute commands in LIFO order (add new commands
>>to the head of the Q).
>>This behavior can cause a starvation of commands (or at least long delays).
>>What is the proper solution to this?
> 
> 
> Well, to use the proper interfaces.
> 
> scsi_do_req is deprecated, so don't use it.  scsi_wait_req is its
> replacement.

James,
scsi_wait_req() doesn't look like a replacement of
scsi_do_req() to me. The "wait" call is synchronous
while scsi_do_req() is asynchronous with a done()
callback.

  Note: they're only really intended to allow ULDs to
> execute commands that are necessary for controlling the device (that's
> why they go at the head of the queue).

The "char" ULDs use scsi_do_req() exclusively for
SCSI command injection. The sg driver could be sharing
the device with sd driver, but then again it could
be talking to a SES target. The block layer SG_IO ioctl
is the only use in "mixed" mode (e.g. smartmontools
usage). However the block layer SG_IO is not being
used in "mixed" mode when a CD/DVD is being burnt.
IMO the mid level should not arbitrarily adopt LIFO
order.

   Block commands are executed in
> order using ULD init_command() (or REQ_BLOCK_PC).

OSDs break the UNIX block paradigm. Perhaps
it's time to start thinking about how to properly
support them.

Doug Gilbert

  reply	other threads:[~2005-06-03  0:02 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-02 17:31 SCSI commands order when using scsi_do_req Liran Schour
2005-06-02 17:54 ` James Bottomley
2005-06-03  0:03   ` Douglas Gilbert [this message]
2005-06-06  8:32     ` Liran Schour
2005-06-06 14:32       ` James Bottomley
2005-06-07  9:27         ` Liran Schour
2005-06-17  9:08   ` Vladislav Bolkhovitin

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=429F9E38.4070700@torque.net \
    --to=dougg@torque.net \
    --cc=James.Bottomley@SteelEye.com \
    --cc=LIRANS@il.ibm.com \
    --cc=linux-scsi@vger.kernel.org \
    /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