All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff Garzik <jgarzik@pobox.com>
To: Andy Warner <andyw@pobox.com>
Cc: linville@redhat.com, linux-ide@vger.kernel.org
Subject: libata and queueing (was Re: [t13] RE: comment on T10 ATA-passthru)
Date: Sun, 14 Nov 2004 19:43:22 -0500	[thread overview]
Message-ID: <4197FBAA.5030703@pobox.com> (raw)
In-Reply-To: <20041101201240.A16317@florence.linkmargin.com>

Andy Warner wrote:
> Jeff Garzik wrote:
> 
>>[I ask about NCQ ...]
>>Most of the code is already written to assume that queueing is
>>active.  Turning on NCQ in libata is trivial.  Handling errors and
>>synchronization is less trivial :)
> 
> 
> I guess I'm a little gun shy here :) Remember, my induction to
> hotplug consisted of:
> 
> 	"That's because libata doesn't call the proper hot-unplug hooks.
> 	 Call those hooks, and the problem goes away."
> 
> I really don't want to hugely underestimate the effort involved.
> 
> Things that I can't quite see being in there right now
> are the low-level state machine support for queued events,
> and data structures and functions required to queue the pending
> requests.
> 
> The boundary conditions you allude to seem likely to be
> a pandora's box. Not the least of which will be ensuring
> that queued and non-queued commands never mingle. It is
> my understanding that any non-queued command will abort
> *all* pending queued commands with unpredictable results
> for data in flight.

Everything is a pandora's box :)  Nobody said storage was easy :)

My advice for any efforts, whether it's NCQ or hotplug or whatever, is: 
  post early, post often.  Design in public first, get the design nailed 
down, _then_ settle in for some testing.

One of the key problems is that a lot of the future directions and 
current methodology isn't written down, so you need to pelt me (CC'ing 
linux-ide, to share the knowledge) with email asking questions.

[side note: anyone is welcome to patch Documentation/DocBook/libata.tmpl 
with new knowledge]


Now, back to queueing specifically...

libata currently relies on the SCSI layer to handle queueing (or lack 
thereof), and to handle arbitration between master/slave in PATA 
configurations.

There is minimal infrastructure in libata for queueing:  32 commands 
(ata_queued_cmd) per ata_device, but that's mainly for storage of 
per-command metadata.

To implement queueing in libata, you'll use the current libata 
per-command infrastructure, and the SCSI mid-layer's queueing 
infrastructure in concert.  The SCSI mid-layer API is used to control 
the queue depth.  For exceptional cases such as error handling and 
non-queue-able commands, you'll return host-busy to the SCSI mid-layer 
from the libata ->queuecommand hook.

Error handling consists of knowing which commands to retry, which to 
fail, and which to partially complete.


      reply	other threads:[~2004-11-15  0:43 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <A9B8FF43A76C0D42A80DDD73CF99BEC80548967B@azsmsx407>
     [not found] ` <20041029142539.A29944@florence.linkmargin.com>
2004-10-29 19:43   ` [t13] RE: comment on T10 ATA-passthru Jeff Garzik
2004-10-29 20:39     ` Andy Warner
2004-10-29 20:50       ` Jeff Garzik
2004-10-29 21:16         ` Andy Warner
2004-11-02  2:12         ` Andy Warner
2004-11-15  0:43           ` Jeff Garzik [this message]

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=4197FBAA.5030703@pobox.com \
    --to=jgarzik@pobox.com \
    --cc=andyw@pobox.com \
    --cc=linux-ide@vger.kernel.org \
    --cc=linville@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.