Skip to contentSkip to conversation

storvsc: use small sg_tablesize on x86

PATCH Superseded Olaf Hering 3 participants 11 messages Sep 8, 2015 – Feb 26, 2016

Subsystems (2)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 storvsc: use small sg_tablesize on x86

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
---
 drivers/scsi/storvsc_drv.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/scsi/storvsc_drv.c +5 -0
index 40c43ae..36bf183 100644
@@ -1907,6 +1907,11 @@ static int storvsc_probe(struct hv_device *device,
 	 * from the host.
 	 */
 	host->sg_tablesize = (stor_device->max_transfer_bytes >> PAGE_SHIFT);
+#if defined(CONFIG_X86_32)
+	dev_warn(&device->device, "adjusting sg_tablesize 0x%x -> 0x%x",
+			host->sg_tablesize, MAX_MULTIPAGE_BUFFER_COUNT);
+	host->sg_tablesize = MAX_MULTIPAGE_BUFFER_COUNT;
+#endif
 
 	/* Register the HBA and start the scsi bus scan */
 	ret = scsi_add_host(host, &device->device);
Reviewed-by on v1 1/1
#1 lore raw
Quoted 11 lines

-----Original Message-----
From: Olaf Hering [mailto:[email protected]]
Sent: Tuesday, September 8, 2015 3:07 AM
To: KY Srinivasan <[email protected]>; Haiyang Zhang <[email protected]>; [email protected]
Cc: [email protected]; [email protected]; Olaf Hering <[email protected]>
Subject: [PATCH] storvsc: use small sg_tablesize on x86

Quoted 7 lines

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
Quoted 22 lines
---
 drivers/scsi/storvsc_drv.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/scsi/storvsc_drv.c +5 -0
index 40c43ae..36bf183 100644
@@ -1907,6 +1907,11 @@ static int storvsc_probe(struct hv_device *device,
 	 * from the host.
 	 */
 	host->sg_tablesize = (stor_device->max_transfer_bytes >>
 PAGE_SHIFT);
+#if defined(CONFIG_X86_32)
+	dev_warn(&device->device, "adjusting sg_tablesize 0x%x -> 0x%x",
+			host->sg_tablesize,
 MAX_MULTIPAGE_BUFFER_COUNT);
+	host->sg_tablesize = MAX_MULTIPAGE_BUFFER_COUNT;
+#endif
 
drivers/scsi/storvsc_drv.c +0 -0
 	/* Register the HBA and start the scsi bus scan */
 	ret = scsi_add_host(host, &device->device);
maintainer
#2 lore raw
Quoted 22 lines · KY Srinivasan
Quoted 10 lines

-----Original Message-----
From: Olaf Hering [mailto:[email protected]]
Sent: Tuesday, September 8, 2015 3:07 AM
To: KY Srinivasan <[email protected]>; Haiyang Zhang <[email protected]>; [email protected]
Cc: [email protected]; [email protected]; Olaf Hering <[email protected]>
Subject: [PATCH] storvsc: use small sg_tablesize on x86

Quoted 7 lines

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
Quoted 4 lines
---
 drivers/scsi/storvsc_drv.c | 5 +++++
 1 file changed, 5 insertions(+)
Quoted 15 lines
Quoted 5 lines
drivers/scsi/storvsc_drv.c +0 -0
index 40c43ae..36bf183 100644

drivers/scsi/storvsc_drv.c static int storvsc_probe(struct hv_device *device, · line 1916

Quoted 10 lines
drivers/scsi/storvsc_drv.c +5 -0
@@ -1907,6 +1907,11 @@ static int storvsc_probe(struct hv_device *device,
 	 * from the host.
 	 */
 	host->sg_tablesize = (stor_device->max_transfer_bytes >>
 PAGE_SHIFT);
+#if defined(CONFIG_X86_32)
+	dev_warn(&device->device, "adjusting sg_tablesize 0x%x -> 0x%x",
+			host->sg_tablesize,
 MAX_MULTIPAGE_BUFFER_COUNT);
+	host->sg_tablesize = MAX_MULTIPAGE_BUFFER_COUNT;
+#endif

Um, this is a bit architecture specific (I know Azure is x86, but still). Can you make the define check CONFIG_32BIT rather than CONFIG_X86_32?

James

#3 lore raw
Quoted 41 lines

-----Original Message-----
From: James Bottomley [mailto:[email protected]]
Sent: Thursday, October 1, 2015 1:52 PM
To: KY Srinivasan <[email protected]>
Cc: Olaf Hering <[email protected]>; Haiyang Zhang <[email protected]>; [email protected]; linux- [email protected]
Subject: Re: [PATCH] storvsc: use small sg_tablesize on x86

Quoted 10 lines · KY Srinivasan
Quoted 10 lines

-----Original Message-----
From: Olaf Hering [mailto:[email protected]]
Sent: Tuesday, September 8, 2015 3:07 AM
To: KY Srinivasan <[email protected]>; Haiyang Zhang <[email protected]>; [email protected]
Cc: [email protected]; [email protected]; Olaf Hering <[email protected]>
Subject: [PATCH] storvsc: use small sg_tablesize on x86

Quoted 2 lines
Quoted 2 lines

Reducing the sg_tablesize allows booting of 32bit kernels in VMs, after commit be0cf6ca301c61458dc4aa1a37acf4f58d2ed3d6 ("scsi: storvsc: Set

the

Quoted 10 lines
Quoted 5 lines

tablesize based on the information given by the host")

[    5.567138] hv_storvsc vmbus_1: adjusting sg_tablesize 0x800 -> 0x20
Quoted 4 lines
---
 drivers/scsi/storvsc_drv.c | 5 +++++
 1 file changed, 5 insertions(+)
Quoted 5 lines

drivers/scsi/storvsc_drv.c static int storvsc_probe(struct hv_device

Quoted 5 lines
drivers/scsi/storvsc_drv.c +0 -0
index 40c43ae..36bf183 100644
@@ -1907,6 +1907,11 @@ static int storvsc_probe(struct hv_device

*device,

Quoted 14 lines
Quoted 10 lines

drivers/scsi/storvsc_drv.c static int storvsc_probe(struct hv_device *device, · line 1914

Quoted 10 lines
drivers/scsi/storvsc_drv.c +5 -0
 	 * from the host.
 	 */
 	host->sg_tablesize = (stor_device->max_transfer_bytes >>
 PAGE_SHIFT);
+#if defined(CONFIG_X86_32)
+	dev_warn(&device->device, "adjusting sg_tablesize 0x%x -> 0x%x",
+			host->sg_tablesize,
 MAX_MULTIPAGE_BUFFER_COUNT);
+	host->sg_tablesize = MAX_MULTIPAGE_BUFFER_COUNT;
+#endif

Um, this is a bit architecture specific (I know Azure is x86, but still). Can you make the define check CONFIG_32BIT rather than CONFIG_X86_32?

Thanks, will do.

K. Y

Quoted 4 lines

James

#4 lore raw
In reply to James Bottomley
Quoted 7 lines · James Bottomley
Quoted 1 line · KY Srinivasan
Quoted 1 line

+#if defined(CONFIG_X86_32)

Um, this is a bit architecture specific (I know Azure is x86, but still). Can you make the define check CONFIG_32BIT rather than CONFIG_X86_32?

According to arch/x86/Kconfig there is no such thing.

Olaf

#5 lore raw
Quoted 11 lines · Olaf Hering
Quoted 7 lines · James Bottomley
Quoted 1 line · KY Srinivasan
Quoted 1 line

+#if defined(CONFIG_X86_32)

Um, this is a bit architecture specific (I know Azure is x86, but still). Can you make the define check CONFIG_32BIT rather than CONFIG_X86_32?

According to arch/x86/Kconfig there is no such thing.

What is the status of this change? Looks like there is nothing more to do on my side.

Olaf

#6 lore raw
Quoted 19 lines

-----Original Message-----
From: Olaf Hering [mailto:[email protected]]
Sent: Monday, January 25, 2016 12:35 AM
To: James Bottomley <[email protected]>
Cc: KY Srinivasan <[email protected]>; Haiyang Zhang <[email protected]>; [email protected]; linux- [email protected]
Subject: Re: [PATCH] storvsc: use small sg_tablesize on x86

Quoted 6 lines · Olaf Hering
Quoted 3 lines · James Bottomley
Quoted 1 line · KY Srinivasan
Quoted 1 line

+#if defined(CONFIG_X86_32)

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines

Um, this is a bit architecture specific (I know Azure is x86, but still). Can you make the define check CONFIG_32BIT rather than CONFIG_X86_32?

According to arch/x86/Kconfig there is no such thing.

What is the status of this change? Looks like there is nothing more to do on my side.

Olaf,

We do have the config option: CONFIG_X86_64. Perhaps we could use this. Could you resubmit the patch with this change.

Regards,

K. Y

Quoted 2 lines

Olaf

maintainer
#7 lore raw
Quoted 25 lines · KY Srinivasan
Quoted 25 lines

-----Original Message-----
From: Olaf Hering [mailto:[email protected]]
Sent: Monday, January 25, 2016 12:35 AM
To: James Bottomley <[email protected]>
Cc: KY Srinivasan <[email protected]>; Haiyang Zhang <[email protected]>; [email protected]; linux- [email protected]
Subject: Re: [PATCH] storvsc: use small sg_tablesize on x86

Quoted 12 lines · Olaf Hering
Quoted 8 lines · James Bottomley
Quoted 1 line · KY Srinivasan
Quoted 1 line

+#if defined(CONFIG_X86_32)

Um, this is a bit architecture specific (I know Azure is x86, but
still). Can you make the define check CONFIG_32BIT rather than CONFIG_X86_32?

According to arch/x86/Kconfig there is no such thing.

Quoted 7 lines
Quoted 2 lines

What is the status of this change? Looks like there is nothing more to do on my side.

Olaf,

We do have the config option: CONFIG_X86_64. Perhaps we could use this. Could you resubmit the patch with this change.

It's not really architecture independent, is it? Just use the bit width config.

James

#8 lore raw
Quoted 2 lines · James Bottomley

It's not really architecture independent, is it? Just use the bit width config.

Again: which one? This driver is not for mips|powerpc|score|sh.

Olaf

maintainer
#9 lore raw
Quoted 6 lines · Olaf Hering
Quoted 2 lines · James Bottomley

It's not really architecture independent, is it? Just use the bit width config.

Again: which one? This driver is not for mips|powerpc|score|sh.

zgrep CONFIG_.*BIT /proc/config.gz
[...]
CONFIG_64BIT=y

James

#10 lore raw
Quoted 17 lines

-----Original Message-----
From: James Bottomley [mailto:[email protected]]
Sent: Thursday, January 28, 2016 7:37 AM
To: Olaf Hering <[email protected]>
Cc: KY Srinivasan <[email protected]>; Haiyang Zhang <[email protected]>; [email protected]; linux- [email protected]
Subject: Re: [PATCH] storvsc: use small sg_tablesize on x86

Quoted 5 lines · Olaf Hering
Quoted 2 lines · James Bottomley

It's not really architecture independent, is it? Just use the bit width config.

Quoted 7 lines
Quoted 1 line

Again: which one? This driver is not for mips|powerpc|score|sh.

zgrep CONFIG_.*BIT /proc/config.gz
[...]
CONFIG_64BIT=y

James

Olaf,

Would you be resubmitting this patch?

Thanks,

K. Y