linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3] storvsc: use small sg_tablesize on x86
@ 2016-06-09 16:25 Olaf Hering
  2016-06-09 17:25 ` James Bottomley
  0 siblings, 1 reply; 4+ messages in thread
From: Olaf Hering @ 2016-06-09 16:25 UTC (permalink / raw)
  To: K. Y. Srinivasan, Haiyang Zhang, James E.J. Bottomley,
	Martin K. Petersen
  Cc: devel, linux-kernel, linux-scsi, Olaf Hering

Reducing the sg_tablesize allows booting of 32bit kernels in VMs, after
commit be0cf6ca301c61458dc4aa1a37acf4f58d2ed3d6 ("scsi: storvsc: Set the
tablesize based on the information given by the host")

[    5.567138] hv_storvsc vmbus_1: adjusting sg_tablesize 0x800 -> 0x20

Signed-off-by: Olaf Hering <olaf@aepfle.de>
---

As requested, use CONFIG_<bitsize>. For some reason IS_ENABLED(64_BIT)
does not work.

 drivers/scsi/storvsc_drv.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c
index 3ddcabb..ae42324 100644
--- a/drivers/scsi/storvsc_drv.c
+++ b/drivers/scsi/storvsc_drv.c
@@ -1673,11 +1673,15 @@ static int storvsc_probe(struct hv_device *device,
 	/* max cmd length */
 	host->max_cmd_len = STORVSC_MAX_CMD_LEN;
 
+#ifdef CONFIG_64BIT
 	/*
 	 * set the table size based on the info we got
 	 * from the host.
 	 */
 	host->sg_tablesize = (stor_device->max_transfer_bytes >> PAGE_SHIFT);
+#else
+	host->sg_tablesize = MAX_MULTIPAGE_BUFFER_COUNT;
+#endif
 
 	/* Register the HBA and start the scsi bus scan */
 	ret = scsi_add_host(host, &device->device);

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

* Re: [PATCH v3] storvsc: use small sg_tablesize on x86
  2016-06-09 16:25 [PATCH v3] storvsc: use small sg_tablesize on x86 Olaf Hering
@ 2016-06-09 17:25 ` James Bottomley
  2016-06-09 22:01   ` Olaf Hering
  0 siblings, 1 reply; 4+ messages in thread
From: James Bottomley @ 2016-06-09 17:25 UTC (permalink / raw)
  To: Olaf Hering, K. Y. Srinivasan, Haiyang Zhang, Martin K. Petersen
  Cc: devel, linux-kernel, linux-scsi

On Thu, 2016-06-09 at 18:25 +0200, Olaf Hering wrote:
> Reducing the sg_tablesize allows booting of 32bit kernels in VMs,
> after
> commit be0cf6ca301c61458dc4aa1a37acf4f58d2ed3d6 ("scsi: storvsc: Set
> the
> tablesize based on the information given by the host")
> 
> [    5.567138] hv_storvsc vmbus_1: adjusting sg_tablesize 0x800 -> 
> 0x20

Are you really sure 32 is the correct size?  That caps transfers at 128
k.  Even in the dim, dark, pre-64bit (at least on x86) days, our static
limit for sg tablesize was 128 (0.5M).

I know 32 it what it had before, but the reason for the commit you
quote was to improve performance ...

James

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

* Re: [PATCH v3] storvsc: use small sg_tablesize on x86
  2016-06-09 17:25 ` James Bottomley
@ 2016-06-09 22:01   ` Olaf Hering
  2016-06-15  2:07     ` Martin K. Petersen
  0 siblings, 1 reply; 4+ messages in thread
From: Olaf Hering @ 2016-06-09 22:01 UTC (permalink / raw)
  To: James Bottomley
  Cc: K. Y. Srinivasan, Haiyang Zhang, Martin K. Petersen, devel,
	linux-kernel, linux-scsi

On Thu, Jun 09, James Bottomley wrote:

> On Thu, 2016-06-09 at 18:25 +0200, Olaf Hering wrote:
> > Reducing the sg_tablesize allows booting of 32bit kernels in VMs,
> > after
> > commit be0cf6ca301c61458dc4aa1a37acf4f58d2ed3d6 ("scsi: storvsc: Set
> > the
> > tablesize based on the information given by the host")
> > 
> > [    5.567138] hv_storvsc vmbus_1: adjusting sg_tablesize 0x800 -> 
> > 0x20
> 
> Are you really sure 32 is the correct size?

Its a size that works, while the current state does not work at all.

> I know 32 it what it had before, but the reason for the commit you
> quote was to improve performance ...

The commit above broke 32bit. Whoever wants to improve performance on
this dead horse can submit another patch.

Olaf

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

* Re: [PATCH v3] storvsc: use small sg_tablesize on x86
  2016-06-09 22:01   ` Olaf Hering
@ 2016-06-15  2:07     ` Martin K. Petersen
  0 siblings, 0 replies; 4+ messages in thread
From: Martin K. Petersen @ 2016-06-15  2:07 UTC (permalink / raw)
  To: Olaf Hering
  Cc: James Bottomley, K. Y. Srinivasan, Haiyang Zhang,
	Martin K. Petersen, devel, linux-kernel, linux-scsi

>>>>> "Olaf" == Olaf Hering <olaf@aepfle.de> writes:

Olaf> On Thu, Jun 09, James Bottomley wrote:
>> On Thu, 2016-06-09 at 18:25 +0200, Olaf Hering wrote:
>> > Reducing the sg_tablesize allows booting of 32bit kernels in VMs, >
>> after > commit be0cf6ca301c61458dc4aa1a37acf4f58d2ed3d6 ("scsi:
>> storvsc: Set > the > tablesize based on the information given by the
>> host")
>> > 
>> > [ 5.567138] hv_storvsc vmbus_1: adjusting sg_tablesize 0x800 -> >
>> 0x20
>> 
>> Are you really sure 32 is the correct size?

Olaf> Its a size that works, while the current state does not work at
Olaf> all.

>> I know 32 it what it had before, but the reason for the commit you
>> quote was to improve performance ...

Olaf> The commit above broke 32bit. Whoever wants to improve performance
Olaf> on this dead horse can submit another patch.

K.Y.?

-- 
Martin K. Petersen	Oracle Linux Engineering

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

end of thread, other threads:[~2016-06-15  2:07 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-09 16:25 [PATCH v3] storvsc: use small sg_tablesize on x86 Olaf Hering
2016-06-09 17:25 ` James Bottomley
2016-06-09 22:01   ` Olaf Hering
2016-06-15  2:07     ` Martin K. Petersen

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