All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] scsi/block: increase flush/sync timeout
@ 2010-08-03 19:26 michaelc
  2010-08-04  8:17 ` Boaz Harrosh
  2010-08-25  0:36 ` Bernd Schubert
  0 siblings, 2 replies; 3+ messages in thread
From: michaelc @ 2010-08-03 19:26 UTC (permalink / raw)
  To: linux-scsi, axboe, bs_lists; +Cc: Mike Christie, Mike Christie

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>
---
 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
-- 
1.6.6.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-08-25  0:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-03 19:26 [PATCH] scsi/block: increase flush/sync timeout michaelc
2010-08-04  8:17 ` Boaz Harrosh
2010-08-25  0:36 ` Bernd Schubert

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.