[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <BYAPR21MB1270CD89180A7979F34682EABFB69@BYAPR21MB1270.namprd21.prod.outlook.com>
Date: Tue, 12 Oct 2021 18:05:47 +0000
From: Dexuan Cui <decui@...rosoft.com>
To: "Martin K. Petersen" <martin.petersen@...cle.com>
CC: KY Srinivasan <kys@...rosoft.com>,
Stephen Hemminger <sthemmin@...rosoft.com>,
"wei.liu@...nel.org" <wei.liu@...nel.org>,
"jejb@...ux.ibm.com" <jejb@...ux.ibm.com>,
Haiyang Zhang <haiyangz@...rosoft.com>,
"ming.lei@...hat.com" <ming.lei@...hat.com>,
"bvanassche@....org" <bvanassche@....org>,
"john.garry@...wei.com" <john.garry@...wei.com>,
"linux-scsi@...r.kernel.org" <linux-scsi@...r.kernel.org>,
"linux-hyperv@...r.kernel.org" <linux-hyperv@...r.kernel.org>,
Long Li <longli@...rosoft.com>,
Michael Kelley <mikelley@...rosoft.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"stable@...r.kernel.org" <stable@...r.kernel.org>
Subject: RE: [PATCH v3] scsi: core: Fix shost->cmd_per_lun calculation in
scsi_add_host_with_dma()
> From: Martin K. Petersen <martin.petersen@...cle.com>
> Sent: Tuesday, October 12, 2021 9:42 AM
>
> Dexuan,
>
> > After commit ea2f0f77538c, a 416-CPU VM running on Hyper-V hangs during
> > boot because the hv_storvsc driver sets scsi_driver.can_queue to an "int"
> > value that exceeds SHRT_MAX, and hence scsi_add_host_with_dma() sets
> > shost->cmd_per_lun to a negative "short" value.
> >
> > Use min_t(int, ...) to fix the issue.
>
> I queued this up as a short term workaround. However, I am hoping that
> the rework of the scaling code in storvsc lands soon.
Thanks, Martin! I know Michael Kelley will improve the netvsc.
Regarding this patch, I'm not sure if it's a "workaround": if it's incorrect to
set a bigger-than-SHRT_MAX scsi_driver.can_queue value, probably we should
change scsi_driver.can_queue from "int" to "u16"? BTW, I guess the "cmd_per_lun"
should also be "u16" rather than "short"?
This was discussed in May, and it looks like the conclusion was not clear to me:
https://lwn.net/ml/linux-kernel/457d23a9-deb0-4ee1-fe7f-5a63605d9686@huawei.com/
Thanks,
-- Dexuan
Powered by blists - more mailing lists