scsi: sd: Add a comment about limiting max_sectors to shost optimal limit
authorJohn Garry <john.garry@huawei.com>
Tue, 19 Jul 2022 09:51:04 +0000 (17:51 +0800)
committerChristoph Hellwig <hch@lst.de>
Fri, 22 Jul 2022 15:14:59 +0000 (17:14 +0200)
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>
drivers/scsi/sd.c

index 3eaee1f7aacaf9f35865bc3e5387c594fafe4101..ed9f43f9512ed80c0341a9a47f188339e2ceb646 100644 (file)
@@ -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 */