Skip to contentSkip to conversation

scsi: sd: Add a comment about limiting max_sectors to shost optimal limit

PATCH Applied John Garry 4 participants 4 messages Jul 19, 2022 – Jul 22, 2022 SCSI

lore
Share & tools
lore

John Garry

author
#0 lore raw

PATCH 1/1 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.

drivers/scsi/sd.c +5 -0
index 3eaee1f7aaca..ed9f43f9512e 100644
@@ -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 */
Signature · 1 line
2.35.3
Reviewed-by on v1 1/1
#1 lore raw
Quoted 12 lines · John Garry

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.

drivers/scsi/sd.c +0 -0
index 3eaee1f7aaca..ed9f43f9512e 100644
@@ -3296,6 +3296,11 @@ static int sd_revalidate_disk(struct gendisk *disk)
 				      (sector_t)BLK_DEF_MAX_SECTORS);

drivers/scsi/sd.c static int sd_revalidate_disk(struct gendisk *disk) · line 3306

Quoted 10 lines
drivers/scsi/sd.c +5 -0
 	}
 
+	/*
+	 * 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 */

Looks good.

Signature · 2 lines
Damien Le Moal
Western Digital Research