lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 8 Mar 2021 14:37:40 +0000
From:   Michael Kelley <mikelley@...rosoft.com>
To:     melanieplageman <melanieplageman@...il.com>,
        "linux-scsi@...r.kernel.org" <linux-scsi@...r.kernel.org>
CC:     "andres@...razel.de" <andres@...razel.de>,
        Haiyang Zhang <haiyangz@...rosoft.com>,
        "jejb@...ux.ibm.com" <jejb@...ux.ibm.com>,
        KY Srinivasan <kys@...rosoft.com>,
        "linux-hyperv@...r.kernel.org" <linux-hyperv@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "martin.petersen@...cle.com" <martin.petersen@...cle.com>,
        Stephen Hemminger <sthemmin@...rosoft.com>,
        "wei.liu@...nel.org" <wei.liu@...nel.org>,
        melanieplageman <melanieplageman@...il.com>
Subject: RE: [PATCH v1] scsi: storvsc: Cap cmd_per_lun at can_queue

From: Melanie Plageman (Microsoft) <melanieplageman@...il.com> Sent: Friday, March 5, 2021 3:22 PM
> 
> The scsi_device->queue_depth is set to Scsi_Host->cmd_per_lun during
> allocation.
> 
> Cap cmd_per_lun at can_queue to avoid dispatch errors.
> 
> Signed-off-by: Melanie Plageman (Microsoft) <melanieplageman@...il.com>
> ---
>  drivers/scsi/storvsc_drv.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c
> index 6bc5453cea8a..d7953a6e00e6 100644
> --- a/drivers/scsi/storvsc_drv.c
> +++ b/drivers/scsi/storvsc_drv.c
> @@ -1946,6 +1946,8 @@ static int storvsc_probe(struct hv_device *device,
>  				(max_sub_channels + 1) *
>  				(100 - ring_avail_percent_lowater) / 100;
> 
> +	scsi_driver.cmd_per_lun = min_t(u32, scsi_driver.cmd_per_lun, scsi_driver.can_queue);
> +

I'm not sure what you mean by "avoid dispatch errors".  Can you elaborate?
Be aware that the calculation of "can_queue" in this driver is somewhat
flawed -- it should not be based on the size of the ring buffer, but instead on
the maximum number of requests Hyper-V will queue.  And even then,
can_queue doesn't provide the cap you might expect because the blk-mq layer
allocates can_queue tags for each HW queue, not as a total.

I agree that the cmd_per_lun setting is also too big, but we should fix that in
the context of getting all of these different settings working together correctly,
and not piecemeal.

Michael

>  	host = scsi_host_alloc(&scsi_driver,
>  			       sizeof(struct hv_host_device));
>  	if (!host)
> --
> 2.20.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ