aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/hosts.c
diff options
context:
space:
mode:
authorRen Mingxin <renmx@cn.fujitsu.com>2013-11-11 07:44:56 -0500
committerJames Bottomley <JBottomley@Parallels.com>2013-12-19 10:39:02 -0500
commitbb3b621a33d60fc2baddf31597ade01243e00a2c (patch)
tree73fae0429ce43ce37845e207cb36da2e8f54d42c /drivers/scsi/hosts.c
parent76ad3e5956bf0bc8871ebd19ebda03f2287c966a (diff)
[SCSI] Set the minimum valid value of 'eh_deadline' as 0
The former minimum valid value of 'eh_deadline' is 1s, which means the earliest occasion to shorten EH is 1 second later since a command is failed or timed out. But if we want to skip EH steps ASAP, we have to wait until the first EH step is finished. If the duration of the first EH step is long, this waiting time is excruciating. So, it is necessary to accept 0 as the minimum valid value for 'eh_deadline'. According to my test, with Hannes' patchset 'New EH command timeout handler' as well, the minimum IO time is improved from 73s (eh_deadline = 1) to 43s(eh_deadline = 0) when commands are timed out by disabling RSCN and target port. Signed-off-by: Ren Mingxin <renmx@cn.fujitsu.com> Signed-off-by: Hannes Reinecke <hare@suse.de> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/hosts.c')
-rw-r--r--drivers/scsi/hosts.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/drivers/scsi/hosts.c b/drivers/scsi/hosts.c
index c3ab093dd8a7..f28ea070d3df 100644
--- a/drivers/scsi/hosts.c
+++ b/drivers/scsi/hosts.c
@@ -319,11 +319,11 @@ static void scsi_host_dev_release(struct device *dev)
319 kfree(shost); 319 kfree(shost);
320} 320}
321 321
322static unsigned int shost_eh_deadline; 322static int shost_eh_deadline = -1;
323 323
324module_param_named(eh_deadline, shost_eh_deadline, uint, S_IRUGO|S_IWUSR); 324module_param_named(eh_deadline, shost_eh_deadline, int, S_IRUGO|S_IWUSR);
325MODULE_PARM_DESC(eh_deadline, 325MODULE_PARM_DESC(eh_deadline,
326 "SCSI EH timeout in seconds (should be between 1 and 2^32-1)"); 326 "SCSI EH timeout in seconds (should be between 0 and 2^31-1)");
327 327
328static struct device_type scsi_host_type = { 328static struct device_type scsi_host_type = {
329 .name = "scsi_host", 329 .name = "scsi_host",
@@ -396,9 +396,18 @@ struct Scsi_Host *scsi_host_alloc(struct scsi_host_template *sht, int privsize)
396 shost->unchecked_isa_dma = sht->unchecked_isa_dma; 396 shost->unchecked_isa_dma = sht->unchecked_isa_dma;
397 shost->use_clustering = sht->use_clustering; 397 shost->use_clustering = sht->use_clustering;
398 shost->ordered_tag = sht->ordered_tag; 398 shost->ordered_tag = sht->ordered_tag;
399 shost->eh_deadline = shost_eh_deadline * HZ;
400 shost->no_write_same = sht->no_write_same; 399 shost->no_write_same = sht->no_write_same;
401 400
401 if (shost_eh_deadline == -1)
402 shost->eh_deadline = -1;
403 else if ((ulong) shost_eh_deadline * HZ > INT_MAX) {
404 shost_printk(KERN_WARNING, shost,
405 "eh_deadline %u too large, setting to %u\n",
406 shost_eh_deadline, INT_MAX / HZ);
407 shost->eh_deadline = INT_MAX;
408 } else
409 shost->eh_deadline = shost_eh_deadline * HZ;
410
402 if (sht->supported_mode == MODE_UNKNOWN) 411 if (sht->supported_mode == MODE_UNKNOWN)
403 /* means we didn't set it ... default to INITIATOR */ 412 /* means we didn't set it ... default to INITIATOR */
404 shost->active_mode = MODE_INITIATOR; 413 shost->active_mode = MODE_INITIATOR;