You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
[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>
This commit is contained in:
committed by
James Bottomley
parent
76ad3e5956
commit
bb3b621a33
+13
-4
@@ -319,11 +319,11 @@ static void scsi_host_dev_release(struct device *dev)
|
||||
kfree(shost);
|
||||
}
|
||||
|
||||
static unsigned int shost_eh_deadline;
|
||||
static int shost_eh_deadline = -1;
|
||||
|
||||
module_param_named(eh_deadline, shost_eh_deadline, uint, S_IRUGO|S_IWUSR);
|
||||
module_param_named(eh_deadline, shost_eh_deadline, int, S_IRUGO|S_IWUSR);
|
||||
MODULE_PARM_DESC(eh_deadline,
|
||||
"SCSI EH timeout in seconds (should be between 1 and 2^32-1)");
|
||||
"SCSI EH timeout in seconds (should be between 0 and 2^31-1)");
|
||||
|
||||
static struct device_type scsi_host_type = {
|
||||
.name = "scsi_host",
|
||||
@@ -396,9 +396,18 @@ struct Scsi_Host *scsi_host_alloc(struct scsi_host_template *sht, int privsize)
|
||||
shost->unchecked_isa_dma = sht->unchecked_isa_dma;
|
||||
shost->use_clustering = sht->use_clustering;
|
||||
shost->ordered_tag = sht->ordered_tag;
|
||||
shost->eh_deadline = shost_eh_deadline * HZ;
|
||||
shost->no_write_same = sht->no_write_same;
|
||||
|
||||
if (shost_eh_deadline == -1)
|
||||
shost->eh_deadline = -1;
|
||||
else if ((ulong) shost_eh_deadline * HZ > INT_MAX) {
|
||||
shost_printk(KERN_WARNING, shost,
|
||||
"eh_deadline %u too large, setting to %u\n",
|
||||
shost_eh_deadline, INT_MAX / HZ);
|
||||
shost->eh_deadline = INT_MAX;
|
||||
} else
|
||||
shost->eh_deadline = shost_eh_deadline * HZ;
|
||||
|
||||
if (sht->supported_mode == MODE_UNKNOWN)
|
||||
/* means we didn't set it ... default to INITIATOR */
|
||||
shost->active_mode = MODE_INITIATOR;
|
||||
|
||||
Reference in New Issue
Block a user