linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] scsi: sd: Add a comment about limiting max_sectors to shost optimal limit
@ 2022-07-19  9:51 John Garry
  2022-07-19 10:06 ` Damien Le Moal
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: John Garry @ 2022-07-19  9:51 UTC (permalink / raw)
  To: jejb, martin.petersen, hch, damien.lemoal
  Cc: linux-scsi, linux-kernel, iommu, 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.

Suggested-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Signed-off-by: John Garry <john.garry@huawei.com>

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 */
-- 
2.35.3


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] scsi: sd: Add a comment about limiting max_sectors to shost optimal limit
  2022-07-19  9:51 [PATCH] scsi: sd: Add a comment about limiting max_sectors to shost optimal limit John Garry
@ 2022-07-19 10:06 ` Damien Le Moal
  2022-07-20  1:21 ` Martin K. Petersen
  2022-07-22 15:15 ` Christoph Hellwig
  2 siblings, 0 replies; 4+ messages in thread
From: Damien Le Moal @ 2022-07-19 10:06 UTC (permalink / raw)
  To: John Garry, jejb, martin.petersen, hch; +Cc: linux-scsi, linux-kernel, iommu

On 7/19/22 18:51, John Garry wrote:
> 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>
> 
> 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 */

Looks good.

Reviewed-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>

-- 
Damien Le Moal
Western Digital Research

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] scsi: sd: Add a comment about limiting max_sectors to shost optimal limit
  2022-07-19  9:51 [PATCH] scsi: sd: Add a comment about limiting max_sectors to shost optimal limit John Garry
  2022-07-19 10:06 ` Damien Le Moal
@ 2022-07-20  1:21 ` Martin K. Petersen
  2022-07-22 15:15 ` Christoph Hellwig
  2 siblings, 0 replies; 4+ messages in thread
From: Martin K. Petersen @ 2022-07-20  1:21 UTC (permalink / raw)
  To: John Garry
  Cc: jejb, martin.petersen, hch, damien.lemoal, linux-scsi,
	linux-kernel, iommu


John,

> 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.

Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] scsi: sd: Add a comment about limiting max_sectors to shost optimal limit
  2022-07-19  9:51 [PATCH] scsi: sd: Add a comment about limiting max_sectors to shost optimal limit John Garry
  2022-07-19 10:06 ` Damien Le Moal
  2022-07-20  1:21 ` Martin K. Petersen
@ 2022-07-22 15:15 ` Christoph Hellwig
  2 siblings, 0 replies; 4+ messages in thread
From: Christoph Hellwig @ 2022-07-22 15:15 UTC (permalink / raw)
  To: John Garry
  Cc: jejb, martin.petersen, hch, damien.lemoal, linux-scsi,
	linux-kernel, iommu

Thanks, applied.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-07-22 15:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-19  9:51 [PATCH] scsi: sd: Add a comment about limiting max_sectors to shost optimal limit John Garry
2022-07-19 10:06 ` Damien Le Moal
2022-07-20  1:21 ` Martin K. Petersen
2022-07-22 15:15 ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).