From: Ankit Jain <jankit@suse.de>
To: David Jeffery <dhjeffery@gmail.com>
Cc: linux-scsi@vger.kernel.org
Subject: Re: [PATCH] Reduce error recovery time by reducing use of TURs
Date: Thu, 26 May 2011 13:37:16 +0530 [thread overview]
Message-ID: <4DDE0A34.7090300@suse.de> (raw)
In-Reply-To: <4DD56448.7060003@gmail.com>
On 05/20/2011 12:11 AM, David Jeffery wrote:
>...
>
> /**
> + * scsi_eh_test_devices - check if devices are responding from error recovery.
> + * @cmd_list: scsi commands in error recovery.
> + * @work_q: queue for commands which still need more error recovery
> + * @done_q: queue for commands which are finished
> + * @try_stu: boolean on if a STU command should be tried in addition to TUR.
> + *
> + * Decription:
> + * Tests if devices are in a working state. Commands to devices now in
> + * a working state are sent to the done_q while commands to devices which
> + * are still failing to respond are returned to the work_q for more
> + * processing.
> + **/
> +static int scsi_eh_test_devices(struct list_head *cmd_list, struct list_head *work_q, struct list_head *done_q, int try_stu)
> +{
> + struct scsi_cmnd *scmd, *next;
> + struct scsi_device *sdev;
> + int finish_cmds;
> +
> + while (!list_empty(cmd_list)) {
> + scmd = list_entry(cmd_list->next, struct scsi_cmnd, eh_entry);
> + sdev = scmd->device;
> +
> + finish_cmds = !scsi_device_online(scmd->device) ||
> + (try_stu && !scsi_eh_try_stu(scmd) && !scsi_eh_tur(scmd)) ||
> + !scsi_eh_tur(scmd);
If "(try_stu && !scsi_eh_try_stu(scmd) && !scsi_eh_tur(scmd))" is false,
then this could be sending the TUR command twice. I'm very new to this,
so am not sure what the cost/implication of doing that might be, but it
seems like, that wasn't the intention.
Thanks,
--
Ankit Jain
SUSE Labs
prev parent reply other threads:[~2011-05-26 8:05 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-19 18:41 [PATCH] Reduce error recovery time by reducing use of TURs David Jeffery
2011-05-24 16:53 ` James Bottomley
2011-05-26 5:14 ` Desai, Kashyap
2011-05-26 8:07 ` Ankit Jain [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=4DDE0A34.7090300@suse.de \
--to=jankit@suse.de \
--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 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.