public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Hannes Reinecke <hare@suse.de>
To: James Bottomley <James.Bottomley@HansenPartnership.com>
Cc: Roland Dreier <roland@purestorage.com>,
	linux-scsi <linux-scsi@vger.kernel.org>
Subject: Re: SCSI error handling -- one error blocks the whole SCSI host
Date: Mon, 27 May 2013 16:39:21 +0200	[thread overview]
Message-ID: <51A37019.3050604@suse.de> (raw)
In-Reply-To: <1369608242.1904.7.camel@dabdike>

On 05/27/2013 12:44 AM, James Bottomley wrote:
> 
> On Thu, 2013-05-23 at 11:14 -0700, Roland Dreier wrote:
>> At LSF this year, we had a discussion about error handling and in
>> particular the problem that SCSI midlayer error handling waits for the
>> entire SCSI host (HBA) to quiesce before it starts to abort commands
>> etc.
>>
>> James made the suggestion that FC should handle things the way SAS
>> does, because SAS has a strategy handler that does things the right
>> way.  However, now that I finally sit down and look at the code, I
>> don't see how this is the case.  It seems inherent in the way that
>> scsi_eh_scmd_add() and the thread in scsi_error_handler() work (in
>> particular the strategy handler can't even be called until host_failed
>> == host_busy; we don't bump host_failed without SHOST_RECOVERY set,
>> which stops queueing commands to any devices attached to the whole
>> HBA).
>>
>> James, am I understanding your suggestion properly?  If so can you
>> explain what you meant about the libsas code -- I see that it has its
>> own strategy handler but as I said before we've already stopped every
>> device attached to the HBA before we ever get there.
> 
> It is, but I checked: Apparently it's not implemented in the sas
> transport class.  The original discussion when libsas was constructed,
> as I remember it, was about using the scsi timeout handler to implement
> a running abort.  The idea is fairly simple: you use the first fire of
> eh_timed_out to trigger the abort (or LUN reset) while simultaneously
> returning BLK_EH_RESET_TIMER.  If the timer fires again and the abort
> hasn't returned, you escalate, otherwise you resend the command when the
> abort returns.  This allows you to handle single command failures (up to
> LUN reset) without stopping the host.  Obviously, if you have to
> escalate to device reset, then you need to start the eh thread.
> 
There are some problems with that:

- Returning BLK_EH_RESET_TIMER will restart the timer with the
  _default_ blk timeout. Whereas the _abort_ timeout might
  (and, for some LLDDs, it definitely is) different from
  that.
- Leaving the command running while abort is active will
  inevitably risk a double completion on the original command;
  the command abort might terminate the command at the
  same time as the (real) completion comes in.
  'Normal' command timeouts are protected against this via
  REQ_ATOM_COMPLETE; commands aborted via scsi_finish_cmnd()
  are not.
- LLDDs typically won't return a command status even for a
  command which has been aborted via ABORT TASK TMF.
  So the midlayer probably will never get notified if
  the command got aborted via ABORT TASK.

Especially the last point made me abandon this idea for my EH
rewrite. We would be having a real benefit if we somehow could get
the command status _from the target_ for an aborted command.
But as it appears we won't.
So as any status is made up anyway I'd very much prefer to have it
set by the midlayer. Which renders the whole operation quite
pointless and we're better off using the existing syntax for command
aborts.
Plus it makes life _so much_ easier for the implementation ...

But to answer Roland: Have you checked my patchset?
It should help for command timeouts ...

Cheers,

Hannes
-- 
Dr. Hannes Reinecke		      zSeries & Storage
hare@suse.de			      +49 911 74053 688
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: J. Hawn, J. Guild, F. Imendörffer, HRB 16746 (AG Nürnberg)
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2013-05-27 14:39 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-23 18:14 SCSI error handling -- one error blocks the whole SCSI host Roland Dreier
2013-05-25 18:07 ` James Smart
2013-05-26 22:44 ` James Bottomley
2013-05-27 14:39   ` Hannes Reinecke [this message]
2013-05-27 20:41     ` James Bottomley
2013-05-28  1:32       ` Baruch Even
2013-05-28 14:38         ` Jeremy Linton
2013-05-28 16:22           ` Baruch Even

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=51A37019.3050604@suse.de \
    --to=hare@suse.de \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=roland@purestorage.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