linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Garzik <jgarzik@pobox.com>
To: Tejun Heo <htejun@gmail.com>
Cc: linux-ide@vger.kernel.org, albertcc@tw.ibm.com, mlord@pobox.com,
	lkosewsk@gmail.com, luben_tuikov@adaptec.com,
	Alan Cox <alan@lxorguk.ukuu.org.uk>,
	Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>,
	Jens Axboe <axboe@suse.de>
Subject: Re: [SUMMARY] libata EH
Date: Sun, 21 Aug 2005 00:09:58 -0400	[thread overview]
Message-ID: <4307FE96.10405@pobox.com> (raw)
In-Reply-To: <430768E2.60808@gmail.com>

Tejun Heo wrote:
> Jeff Garzik wrote:
>> Simple stuff like "command aborted" (invalid command) can be handled 
>> immediately, no need to kick in the error handling.

>> But as long as the right hardware interrupts are acknowledged, I don't 
>> mind if all error handling is moved to the thread.

>  My preference is toward unifying into single path as long as 
> performance penalty is acceptable for the sake of simplicity.

The hot path is completing reads and writes successfully.
Secondary hot path is completing <other commands> successfully.

For everything else, clear, simple, maintainable code is preferred over 
fast code.


>>> 2. Synchronization
>>>
>>>     * SCSI EH entrance is not synchronized with normal processing.
>>>       ATAPI error handling/timeout handling can run concurrently
>>>       with normal command processing.  Albert, I think it's the
>>>       same problem you're trying to solve by moving ATA_QCFLAG_ACTIVE
>>>       clearing.
>>>
>>>       http://marc.theaimsgroup.com/?l=linux-ide&m=112417360223374&w=2
>>
>>
>>
>> The SCSI layer stops all command processing before calling 
>> ->eh_strategy_handler().  Where do you see that it runs concurrently 
>> with normal command processing?  That should definitely -not- be 
>> happening.
>>
> 
>  There are currently two problems.
> 
>  * As we don't grab host_set lock on entry to ata_scsi_error(), we can
>    run concurrently with latter part of ata_qc_complete().  This race is
>    addressed by the following patches I've just posted.
> 
>    http://marc.theaimsgroup.com/?l=linux-ide&m=112454734102242&w=2


hmmmmm.  I can see a bit of that:

When ->eh_strategy_handler() is called, the SCSI layer has stopped 
sending commands to all ports on the specified SCSI host.

However, it looks like we can race against
(a) interrupt handler completing a command on another port
(b) interrupt handler belatedly completing a command on our port
(c) if polling, another kernel thread

(a) shouldn't matter right now, but will in the future when we take a 
host-reset action that can 'blip' all ports.
(b) is a -very- rare worry in ATA, since commands that don't complete 
after 30 seconds probably will never complete.  But given how CHECK 
CONDITION is implemented in libata's ATAPI code, falling immediately 
over to the EH, this might be a real concern for ATAPI.
(c) was mentioned in previous emails.  A rare worry.

Did I miss anything?


>  * After entering EH, normal command completion or spurious interrupt
>    can occur.  We currently don't peg those interrupts, so interrupt
>    handling can interfere with EH.

As long as it is not the local port, it shouldn't interfere with EH 
(currently).


>  As there are concerns regarding semantics of ->eh_strategy_handler and 
> it's a less-used and less-charted territory, I'm gonna try to write a 
> document describing the following.
> 
>  * How SCSI EH works and commands flow through it with the default
>    fine-grained hooks.
>  * From above, extract what ->eh_strategy_handler() should do.
>  * What libata error conditions are there and how qc's should be
>    handle.
>  * How to integrate libata EH into SCSI EH without losing commands.
> 
>  I don't how good the doc will turn out (don't expect too much), but I 
> hope it could serve as a basis for discussion if nothing else.

It would certainly be nice to get all of this written down.


>  After writing above mentioned doc, I'll try to improve/revise and break 
> down my previously posted EH patchset and explain how they conform to 
> above yet-to-be-written document such that it can be better understood 
> and easier to review/debug.

Cool.  Thank you.

I'll get those patches reviewed sometime this weekend.

	Jeff



      parent reply	other threads:[~2005-08-21  4:10 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-20  2:33 [SUMMARY] libata EH Tejun Heo
2005-08-20  4:48 ` Jeff Garzik
2005-08-20 17:31   ` Tejun Heo
2005-08-20 20:02     ` Alan Cox
2005-08-21  4:09     ` 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=4307FE96.10405@pobox.com \
    --to=jgarzik@pobox.com \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=albertcc@tw.ibm.com \
    --cc=axboe@suse.de \
    --cc=bzolnier@gmail.com \
    --cc=htejun@gmail.com \
    --cc=linux-ide@vger.kernel.org \
    --cc=lkosewsk@gmail.com \
    --cc=luben_tuikov@adaptec.com \
    --cc=mlord@pobox.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;
as well as URLs for NNTP newsgroup(s).