From: Boaz Harrosh <bharrosh@panasas.com>
To: michaelc@cs.wisc.edu
Cc: linux-scsi@vger.kernel.org, axboe@kernel.dk,
bs_lists@aakef.fastmail.fm, Mike Christie <mchristi@redhat.com>
Subject: Re: [PATCH] scsi/block: increase flush/sync timeout
Date: Wed, 04 Aug 2010 11:17:38 +0300 [thread overview]
Message-ID: <4C592222.6040707@panasas.com> (raw)
In-Reply-To: <1280863560-4747-1-git-send-email-michaelc@cs.wisc.edu>
On 08/03/2010 10:26 PM, michaelc@cs.wisc.edu wrote:
> From: Mike Christie <mchristi@redhat.com>
>
> We have been seeing the flush request timeout with a wide
> range of hardware from tgt+iser to FC targets from a major vendor.
>
> I did this patch which added a flush timeout:
> http://marc.info/?l=linux-scsi&m=127957359200466&w=2
>
> A problem with that patch is how to determine what value
> should be set and when you need to set it. You will
> not know that you need to increase until it times out
> and fails, then to figure out what to set it to you
> need to set the timeout and try it out a couple times.
>
> So this patch just increases the flush/sync cache timeout
> to 2 minutes. In testing, it has taken at most around 60
> seconds to complete the operation, so I thought 120 would
> be safe and not add that long of delay if the device was
> really jammed and needed the scsi eh.
>
> Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
I'm not sure either way, but you might also use the
request_queue's timeout which is settable from user-mode,
times a factor like "request_queue->timeout * 4"
A slow device might be slower on flush as well.
Or not, just an option ;-)
(Or be really smart like can_queue * single_io_timeout / 2)
Boaz
> ---
> drivers/scsi/sd.c | 4 ++--
> drivers/scsi/sd.h | 1 +
> 2 files changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
> index 108daea..3ef08bd 100644
> --- a/drivers/scsi/sd.c
> +++ b/drivers/scsi/sd.c
> @@ -477,7 +477,7 @@ static int scsi_setup_discard_cmnd(struct scsi_device *sdp, struct request *rq)
>
> static int scsi_setup_flush_cmnd(struct scsi_device *sdp, struct request *rq)
> {
> - rq->timeout = SD_TIMEOUT;
> + rq->timeout = SD_FLUSH_TIMEOUT;
> rq->retries = SD_MAX_RETRIES;
> rq->cmd[0] = SYNCHRONIZE_CACHE;
> rq->cmd_len = 10;
> @@ -1064,7 +1064,7 @@ static int sd_sync_cache(struct scsi_disk *sdkp)
> * flush everything.
> */
> res = scsi_execute_req(sdp, cmd, DMA_NONE, NULL, 0, &sshdr,
> - SD_TIMEOUT, SD_MAX_RETRIES, NULL);
> + SD_FLUSH_TIMEOUT, SD_MAX_RETRIES, NULL);
> if (res == 0)
> break;
> }
> diff --git a/drivers/scsi/sd.h b/drivers/scsi/sd.h
> index f81a930..86e6dc3 100644
> --- a/drivers/scsi/sd.h
> +++ b/drivers/scsi/sd.h
> @@ -19,6 +19,7 @@
> */
> #define SD_TIMEOUT (30 * HZ)
> #define SD_MOD_TIMEOUT (75 * HZ)
> +#define SD_FLUSH_TIMEOUT (120 * HZ)
>
> /*
> * Number of allowed retries
next prev parent reply other threads:[~2010-08-04 8:17 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-03 19:26 [PATCH] scsi/block: increase flush/sync timeout michaelc
2010-08-04 8:17 ` Boaz Harrosh [this message]
2010-08-25 0:36 ` Bernd Schubert
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=4C592222.6040707@panasas.com \
--to=bharrosh@panasas.com \
--cc=axboe@kernel.dk \
--cc=bs_lists@aakef.fastmail.fm \
--cc=linux-scsi@vger.kernel.org \
--cc=mchristi@redhat.com \
--cc=michaelc@cs.wisc.edu \
/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.