aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/sd.c
diff options
context:
space:
mode:
authorJohn Garry <john.garry@huawei.com>2022-07-19 17:51:04 +0800
committerChristoph Hellwig <hch@lst.de>2022-07-22 17:14:59 +0200
commitc9337ad4390cdff8877e64824c2a2827d815743d (patch)
tree0b471835ff8c0eff00a15a18185c36a62aa3d620 /drivers/scsi/sd.c
parentata: libata-scsi: cap ata_device->max_sectors according to shost->max_sectors (diff)
downloadlinux-dev-c9337ad4390cdff8877e64824c2a2827d815743d.tar.xz
linux-dev-c9337ad4390cdff8877e64824c2a2827d815743d.zip
scsi: sd: Add a comment about limiting max_sectors to shost optimal limit
Add a comment about limiting the default the SCSI disk request_queue max_sectors initial value to that of the SCSI host optimal sectors limit. Suggested-by: Damien Le Moal <damien.lemoal@opensource.wdc.com> Signed-off-by: John Garry <john.garry@huawei.com> Reviewed-by: Damien Le Moal <damien.lemoal@opensource.wdc.com> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'drivers/scsi/sd.c')
-rw-r--r--drivers/scsi/sd.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index 3eaee1f7aaca..ed9f43f9512e 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -3296,6 +3296,11 @@ static int sd_revalidate_disk(struct gendisk *disk)
(sector_t)BLK_DEF_MAX_SECTORS);
}
+ /*
+ * Limit default to SCSI host optimal sector limit if set. There may be
+ * an impact on performance for when the size of a request exceeds this
+ * host limit.
+ */
rw_max = min_not_zero(rw_max, sdp->host->opt_sectors);
/* Do not exceed controller limit */