From: Mark Goodwin <mgoodwin@redhat.com>
To: David Jeffery <dhjeffery@gmail.com>
Cc: linux-scsi@vger.kernel.org
Subject: Re: [PATCH RFC] Reduce amount of TURs sent in error recovery
Date: Mon, 11 Apr 2011 10:52:23 +1000 [thread overview]
Message-ID: <4DA250C7.60904@redhat.com> (raw)
In-Reply-To: <4D80F6D0.1010404@gmail.com>
On 03/17/2011 04:43 AM, David Jeffery wrote:
> In error recovery, most scsi error recovery stages will send a TUR command
> for every bad command when a driver's error handler reports success. When
> several bad commands to the same device, this results in a device
> being probed multiple times.
>
> This becomes very problematic if the device or connection is in a state
> where the device still doesn't respond to commands even after a recovery
> function returns success. The error handler must wait for the test
> commands to time out. The time waiting for the redundant commands can
> drastically lengthen error recovery.
>
> This patch alters the scsi mid-layer's error routines to send test commands
> once per device instead of once per bad command. This can drastically
> lower error recovery time.
>
Looks good to me - it should also make recovery times far more predictable,
which is something a lot of sites currently struggle with because it depends
on the workload (number of queued commands at the time of the failure).
With this patch, those sites will need to re-tune their timeouts, right?
Has this been tested on real FC h/w yet, or just with scsi_debug?
We have a patch to make testing easier: it adds a new sd state 'zombie',
which stops a particular device/path from queueing any commands,
basically as follows (not the whole patch, just the gist of it) :
--- a/drivers/scsi/scsi.c
+++ b/drivers/scsi/scsi.c
@@ -554,7 +554,10 @@ int scsi_dispatch_cmd(struct scsi_cmnd *cmd)
cmd->result = (DID_NO_CONNECT << 16);
scsi_done(cmd);
} else {
- rtn = host->hostt->queuecommand(cmd, scsi_done);
+ if (cmd->device->sdev_state == SDEV_ZOMBIE)
+ rtn = 0; /* will timeout so err handler will run */
+ else
+ rtn = host->hostt->queuecommand(cmd, scsi_done);
}
Would we want to consider adding this to the patch set too? It will allow
affected sites to more easily tune their timeouts and redundancy config
(i.e. echo zombie > /sys/block/sdX/device/state to simulate a failure).
Cheers
-- Mark Goodwin
next prev parent reply other threads:[~2011-04-11 0:52 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-16 17:43 [PATCH RFC] Reduce amount of TURs sent in error recovery David Jeffery
2011-03-29 23:09 ` Mike Christie
2011-04-11 0:52 ` Mark Goodwin [this message]
2011-04-11 5:59 ` Mike Christie
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=4DA250C7.60904@redhat.com \
--to=mgoodwin@redhat.com \
--cc=dhjeffery@gmail.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;
as well as URLs for NNTP newsgroup(s).