Staging: hv: storvsc: Move the storage driver out of staging
Subsystems (4)
PATCH 1/1 Staging: hv: storvsc: Move the storage driver out of staging
In preparation for moving the storage driver out of staging, seek community review of the storage driver code.
--- drivers/scsi/Kconfig | 7 + drivers/scsi/Makefile | 3 + drivers/scsi/storvsc_drv.c | 1480 ++++++++++++++++++++++++++++++++++++++ drivers/staging/hv/Kconfig | 6 - drivers/staging/hv/Makefile | 2 - drivers/staging/hv/storvsc_drv.c | 1480 -------------------------------------- 6 files changed, 1490 insertions(+), 1488 deletions(-) create mode 100644 drivers/scsi/storvsc_drv.c delete mode 100644 drivers/staging/hv/storvsc_drv.c
drivers/scsi/Kconfig +7 -0
@@ -666,6 +666,13 @@ config VMWARE_PVSCSI To compile this driver as a module, choose M here: the module will be called vmw_pvscsi. +config HYPERV_STORAGE + tristate "Microsoft Hyper-V virtual storage driver" + depends on SCSI && HYPERV + default HYPERV + help + Select this option to enable the Hyper-V virtual storage driver. + config LIBFC tristate "LibFC module" select SCSI_FC_ATTRS
drivers/scsi/Makefile +3 -0
@@ -141,6 +141,7 @@ obj-$(CONFIG_SCSI_BNX2_ISCSI) += libiscsi.o bnx2i/ obj-$(CONFIG_BE2ISCSI) += libiscsi.o be2iscsi/ obj-$(CONFIG_SCSI_PMCRAID) += pmcraid.o obj-$(CONFIG_VMWARE_PVSCSI) += vmw_pvscsi.o +obj-$(CONFIG_HYPERV_STORAGE) += hv_storvsc.o obj-$(CONFIG_ARM) += arm/
@@ -169,6 +170,8 @@ scsi_mod-$(CONFIG_SCSI_PROC_FS) += scsi_proc.o scsi_mod-y += scsi_trace.o scsi_mod-$(CONFIG_PM) += scsi_pm.o +hv_storvsc-y := storvsc_drv.o + scsi_tgt-y += scsi_tgt_lib.o scsi_tgt_if.o sd_mod-objs := sd.o
drivers/scsi/storvsc_drv.c new file +1480 -0
1,480 lines not on this page · raw message
drivers/staging/hv/Kconfig +0 -6
@@ -1,9 +1,3 @@ -config HYPERV_STORAGE - tristate "Microsoft Hyper-V virtual storage driver" - depends on HYPERV && SCSI - help - Select this option to enable the Hyper-V virtual storage driver. - config HYPERV_NET tristate "Microsoft Hyper-V virtual network driver" depends on HYPERV && NET
drivers/staging/hv/Makefile +0 -2
@@ -1,6 +1,4 @@ obj-$(CONFIG_HYPERV) += hv_timesource.o -obj-$(CONFIG_HYPERV_STORAGE) += hv_storvsc.o obj-$(CONFIG_HYPERV_NET) += hv_netvsc.o -hv_storvsc-y := storvsc_drv.o hv_netvsc-y := netvsc_drv.o netvsc.o rndis_filter.o
drivers/staging/hv/storvsc_drv.c deleted +0 -1480
1,477 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
1.7.4.1
Part of the diff is not shown here. View the raw message.
James Bottomley
maintainerQuoted 2 lines · K. Y. Srinivasan
In preparation for moving the storage driver out of staging, seek community review of the storage driver code.
That's not exactly a very descriptive commit message for me to put into SCSI. It doesn't have to be huge, just something like "driver to enable hyperv windows guest on Linux" or something.
Quoted 7 lines
drivers/scsi/Kconfig | 7 + drivers/scsi/Makefile | 3 + drivers/scsi/storvsc_drv.c | 1480 ++++++++++++++++++++++++++++++++++++++ drivers/staging/hv/Kconfig | 6 - drivers/staging/hv/Makefile | 2 - drivers/staging/hv/storvsc_drv.c | 1480 -------------------------------------- 6 files changed, 1490 insertions(+), 1488 deletions(-)
What tree is this against? The hv/storvsc_drv.c in upstream only has
jejb@dabdike> wc -l drivers/staging/hv/storvsc_drv.c 792 drivers/staging/hv/storvsc_drv.c
i.e. whatever you're sending is double the length (and obviously I have trouble applying the patch.
Review
Quoted 2 lines
+++
b/drivers/scsi/storvsc_drv.c(quoted diff) +0
-0@@ -0,0 +1,1480 @@
So not a detailed review, but a couple of structural observations:
The whole driver is a writeout deadlock trap since I assume you intend for it to be used as root/swap of a linux guest? The writeout deadlock occurs when we can't make forward progress on a direct writeout I/O because one of the GFP_ATOMIC memory allocations in your driver fails. The only way to fix this is to back the allocations with mempools (one per actual device) so you can guarantee that whatever memory pressure the system is under, one command can always make the round trip to storage and back.
You use the locked version of queuecommand, but it looks like you don't need the host lock in the submit path, so why not just use the unlocked version?
The bounce buffer handling for discontiguous sg lists is a complete nightmare. And can't you just fix the hypervisor instead of pulling this level of nastiness in the driver, I mean really, the last piece of real SCSI hardware that failed this badly was produced in the dark ages. Assuming the answer is "no", I really think you need to set the minimum block size to 4k, which will completely avoid the situation.
Minor, but use accessors like shost_priv()
The SET WINDOW command is an obsolete scanner command ... the comment about smart issuing it looks completely bogus, but even if there's something issuing scanner commands and your hypervisor crashes on them, you need to reject it with ILLEGAL_REQUEST not DID_ERROR.
All the business around max segment size and supplying your own merge biovec function looks a bit bogus, don't you just want to disable clustering? This looks like another knock on from the weird hypervisor sg list handling, where you apparently need one sg entry per page. This was originally a bug in the circa 1990 era NCR 53c800 host controllers we then had, so that's actually why the clustering parameter exists ... it's sort of nostalgic to see you resurrecting such an ancient bug.
James
Quoted 12 lines
-----Original Message-----
From: James Bottomley [mailto:[email protected]]
Sent: Saturday, October 15, 2011 5:27 PM
To: KY Srinivasan
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Haiyang Zhang
Subject: Re: [PATCH 1/1] Staging: hv: storvsc: Move the storage driver out of staging
Quoted 7 lines
Quoted 2 lines · K. Y. Srinivasan
In preparation for moving the storage driver out of staging, seek community review of the storage driver code.
That's not exactly a very descriptive commit message for me to put into SCSI. It doesn't have to be huge, just something like "driver to enable hyperv windows guest on Linux" or something.
Sorry about the commit message. I will have a more descriptive message in the next submission.
Quoted 11 lines
Quoted 5 lines
drivers/scsi/Kconfig | 7 + drivers/scsi/Makefile | 3 + drivers/scsi/storvsc_drv.c | 1480++++++++++++++++++++++++++++++++++++++
Quoted 4 lines
drivers/staging/hv/Kconfig | 6 - drivers/staging/hv/Makefile | 2 - drivers/staging/hv/storvsc_drv.c | 1480 -------------------------------------- 6 files changed, 1490 insertions(+), 1488 deletions(-)
Quoted 7 lines
What tree is this against? The
hv/storvsc_drv.cin upstream only hasjejb@dabdike> wc -l
drivers/staging/hv/storvsc_drv.c792drivers/staging/hv/storvsc_drv.ci.e. whatever you're sending is double the length (and obviously I have trouble applying the patch.
This patch moves the file from drivers/staging/hv/ directory to the drivers/scsi directory; hence double the length. I saw an email from Greg earlier where he recommended that the patch we post should not delete/modify the files in the hv directory. When I submit this next, I will take that approach.
Quoted 6 lines
Review
Quoted 3 lines
+++
b/drivers/scsi/storvsc_drv.c(quoted diff) +0
-0@@ -0,0 +1,1480 @@So not a detailed review, but a couple of structural observations:
Quoted 8 lines
The whole driver is a writeout deadlock trap since I assume you intend for it to be used as root/swap of a linux guest? The writeout deadlock occurs when we can't make forward progress on a direct writeout I/O because one of the
GFP_ATOMICmemory allocations in your driver fails. The only way to fix this is to back the allocations with mempools (one per actual device) so you can guarantee that whatever memory pressure the system is under, one command can always make the round trip to storage and back.
I will implement a mempool based allocation scheme as you have suggested.
Quoted 4 lines
You use the locked version of queuecommand, but it looks like you don't need the host lock in the submit path, so why not just use the unlocked version?
Will do.
Quoted 5 lines
The bounce buffer handling for discontiguous sg lists is a complete nightmare. And can't you just fix the hypervisor instead of pulling this level of nastiness in the driver, I mean really, the last piece of real SCSI hardware that failed this badly was produced in the dark ages.
The restrictions (as they are) are really from the windows host side and for what it is worth, I have never seen this code triggered at least for I/O initiated by the file system.
Quoted 2 lines
Assuming the answer is "no", I really think you need to set the minimum block size to 4k, which will completely avoid the situation.
I would love to get rid of the bounce buffer handling code by ensuring that the upper level code would never present scatter gather lists that would trigger bounce buffer handling code. How would I accomplish that.
Quoted 2 lines
Minor, but use accessors like
shost_priv()
Will do.
Quoted 5 lines
The SET WINDOW command is an obsolete scanner command ... the comment about smart issuing it looks completely bogus, but even if there's something issuing scanner commands and your hypervisor crashes on them, you need to reject it with
ILLEGAL_REQUESTnotDID_ERROR.
Will do.
Quoted 8 lines
All the business around max segment size and supplying your own merge biovec function looks a bit bogus, don't you just want to disable clustering? This looks like another knock on from the weird hypervisor sg list handling, where you apparently need one sg entry per page. This was originally a bug in the circa 1990 era NCR 53c800 host controllers we then had, so that's actually why the clustering parameter exists ... it's sort of nostalgic to see you resurrecting such an ancient bug.
I will try to clean this up. Would you want all the cleanup you have suggested here done before the code can be moved out of staging or could you take the code and I could give you the patches to address the issues listed by you. Once again, thanks for taking the time to look at this code.
Regards,
K. Y
James Bottomley
maintainerQuoted 35 lines · KY Srinivasan
Quoted 11 lines
-----Original Message-----
From: James Bottomley [mailto:[email protected]]
Sent: Saturday, October 15, 2011 5:27 PM
To: KY Srinivasan
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Haiyang Zhang
Subject: Re: [PATCH 1/1] Staging: hv: storvsc: Move the storage driver out of stagingQuoted 7 lines
Quoted 2 lines · K. Y. Srinivasan
In preparation for moving the storage driver out of staging, seek community review of the storage driver code.
That's not exactly a very descriptive commit message for me to put into SCSI. It doesn't have to be huge, just something like "driver to enable hyperv windows guest on Linux" or something.
Sorry about the commit message. I will have a more descriptive message in the next submission.
Quoted 13 lines
Quoted 5 lines
drivers/scsi/Kconfig | 7 + drivers/scsi/Makefile | 3 + drivers/scsi/storvsc_drv.c | 1480++++++++++++++++++++++++++++++++++++++
Quoted 4 lines
drivers/staging/hv/Kconfig | 6 - drivers/staging/hv/Makefile | 2 - drivers/staging/hv/storvsc_drv.c | 1480 -------------------------------------- 6 files changed, 1490 insertions(+), 1488 deletions(-)What tree is this against? The
hv/storvsc_drv.cin upstream only has
Quoted 8 lines
Quoted 5 lines
jejb@dabdike> wc -l
drivers/staging/hv/storvsc_drv.c792drivers/staging/hv/storvsc_drv.ci.e. whatever you're sending is double the length (and obviously I have trouble applying the patch.
This patch moves the file from
drivers/staging/hv/directory to thedrivers/scsidirectory; hence double the length.
No, that's not it. Look again: the storvsc_drv.c in staging is removing 1480 lines, but in git head, this file is only 792 lines long ... is there an alternative tree with the rest in?
The point I'm making is that the staging file you're modifying isn't the one I see in Linus' git head, so which git tree is it in (I assume it's somewhere waiting for the merge window)?
[...]
Quoted 11 lines
Quoted 4 lines
The bounce buffer handling for discontiguous sg lists is a complete nightmare. And can't you just fix the hypervisor instead of pulling this level of nastiness in the driver, I mean really, the last piece of real SCSI hardware that failed this badly was produced in the dark ages.
The restrictions (as they are) are really from the windows host side and for what it is
worth, I have never seen this code triggered at least for I/O initiated by the file system.
Quoted 8 lines
Quoted 2 lines
Assuming the answer is "no", I really think you need to set the minimum block size to 4k, which will completely avoid the situation.
I would love to get rid of the bounce buffer handling code by ensuring that the
upper level code would never present scatter gather lists that would trigger bounce buffer
handling code. How would I accomplish that.
OK, so as I read the code, what it can't handle is fragments except at the ends. As long as everything always transfers in multiples of 4k, the problem will never occur. This means that all devices you present need to tell the OS they have 4k sectors. I *think* you can do this by setting blk_limits_io_min() in the driver ... but you'll have to test this. The minimum sector size gets set also in sd.c when we probe the disk. I think that won't override blk_limits_io_min(), but please test (we don't have any SCSI drivers which have ever used this setting).
The way to test, is to read back the /sys/block/<dev>/queue/ settings when presenting a 512 byte sector disk. (And the way to activate your bounce code would be to create a filesystem with a < PAGE_SIZE block size).
James
Quoted 45 lines · James Bottomley
Quoted 35 lines · KY Srinivasan
Quoted 11 lines
-----Original Message-----
From: James Bottomley [mailto:[email protected]]
Sent: Saturday, October 15, 2011 5:27 PM
To: KY Srinivasan
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Haiyang Zhang
Subject: Re: [PATCH 1/1] Staging: hv: storvsc: Move the storage driver out of stagingQuoted 7 lines
Quoted 2 lines · K. Y. Srinivasan
In preparation for moving the storage driver out of staging, seek community review of the storage driver code.
That's not exactly a very descriptive commit message for me to put into SCSI. It doesn't have to be huge, just something like "driver to enable hyperv windows guest on Linux" or something.
Sorry about the commit message. I will have a more descriptive message in the next submission.
Quoted 13 lines
Quoted 5 lines
drivers/scsi/Kconfig | 7 + drivers/scsi/Makefile | 3 + drivers/scsi/storvsc_drv.c | 1480++++++++++++++++++++++++++++++++++++++
Quoted 4 lines
drivers/staging/hv/Kconfig | 6 - drivers/staging/hv/Makefile | 2 - drivers/staging/hv/storvsc_drv.c | 1480 -------------------------------------- 6 files changed, 1490 insertions(+), 1488 deletions(-)What tree is this against? The
hv/storvsc_drv.cin upstream only hasQuoted 8 lines
Quoted 5 lines
jejb@dabdike> wc -l
drivers/staging/hv/storvsc_drv.c792drivers/staging/hv/storvsc_drv.ci.e. whatever you're sending is double the length (and obviously I have trouble applying the patch.
This patch moves the file from
drivers/staging/hv/directory to thedrivers/scsidirectory; hence double the length.
Quoted 7 lines
No, that's not it. Look again: the
storvsc_drv.cin staging is removing 1480 lines, but in git head, this file is only 792 lines long ... is there an alternative tree with the rest in?The point I'm making is that the staging file you're modifying isn't the one I see in Linus' git head, so which git tree is it in (I assume it's somewhere waiting for the merge window)?
I guess it's the staging tree you're looking for.
Signature · 3 lines
Julian Andres Klode - Debian Developer, Ubuntu Member See http://wiki.debian.org/JulianAndresKlode and http://jak-linux.org/.
Quoted 56 lines
-----Original Message-----
From: James Bottomley [mailto:[email protected]]
Sent: Monday, October 17, 2011 10:00 AM
To: KY Srinivasan
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Haiyang Zhang
Subject: RE: [PATCH 1/1] Staging: hv: storvsc: Move the storage driver out of stagingQuoted 7 lines · KY Srinivasan
Quoted 7 lines
-----Original Message-----
From: James Bottomley [mailto:[email protected]]
Sent: Saturday, October 15, 2011 5:27 PM
To: KY Srinivasan
Cc: [email protected]; [email protected]; [email protected]; [email protected];Quoted 5 lines
Quoted 5 lines
[email protected]; [email protected]; Haiyang Zhang
Subject: Re: [PATCH 1/1] Staging: hv: storvsc: Move the storage driver out of stagingOn Fri, 2011-10-14 at 23:28 -0700, K. Y. Srinivasan wrote:
Quoted 8 lines
Quoted 6 lines
Quoted 2 lines
In preparation for moving the storage driver out of staging, seek community review of the storage driver code.
That's not exactly a very descriptive commit message for me to put into SCSI. It doesn't have to be huge, just something like "driver to enable hyperv windows guest on Linux" or something.
Sorry about the commit message. I will have a more descriptive message in the
next
Quoted 21 lines
submission.
Quoted 18 lines
Quoted 5 lines
drivers/scsi/Kconfig | 7 + drivers/scsi/Makefile | 3 + drivers/scsi/storvsc_drv.c | 1480++++++++++++++++++++++++++++++++++++++
Quoted 4 lines
drivers/staging/hv/Kconfig | 6 - drivers/staging/hv/Makefile | 2 - drivers/staging/hv/storvsc_drv.c | 1480 -------------------------------------- 6 files changed, 1490 insertions(+), 1488 deletions(-)What tree is this against? The
hv/storvsc_drv.cin upstream only hasjejb@dabdike> wc -l
drivers/staging/hv/storvsc_drv.c792drivers/staging/hv/storvsc_drv.ci.e. whatever you're sending is double the length (and obviously I have trouble applying the patch.
Quoted 6 lines
Quoted 2 lines
This patch moves the file from
drivers/staging/hv/directory to thedrivers/scsidirectory; hence double the length.No, that's not it. Look again: the
storvsc_drv.cin staging is removing 1480 lines, but in git head, this file is only 792 lines long ... is there an alternative tree with the rest in?
This patch is against Greg's staging tree where recently I merged all of the storage drivers into a single driver. This change may not have percolated up yet - Greg has checked this into his staging tree though.
As I deal with the review comments now, do you want me to get these changes applied first to Greg's tree before you would consider moving this driver to drivers/scsi directory, or could you move the driver as it is in Greg's tree under staging and I could give you patches against the moved driver.
Quoted 35 lines
The point I'm making is that the staging file you're modifying isn't the one I see in Linus' git head, so which git tree is it in (I assume it's somewhere waiting for the merge window)?
[...]
Quoted 11 lines
Quoted 4 lines
The bounce buffer handling for discontiguous sg lists is a complete nightmare. And can't you just fix the hypervisor instead of pulling this level of nastiness in the driver, I mean really, the last piece of real SCSI hardware that failed this badly was produced in the dark ages.
The restrictions (as they are) are really from the windows host side and for what it is
worth, I have never seen this code triggered at least for I/O initiated by the file system.Quoted 8 lines
Quoted 2 lines
Assuming the answer is "no", I really think you need to set the minimum block size to 4k, which will completely avoid the situation.
I would love to get rid of the bounce buffer handling code by ensuring that the
upper level code would never present scatter gather lists that would trigger bounce buffer
handling code. How would I accomplish that.OK, so as I read the code, what it can't handle is fragments except at the ends. As long as everything always transfers in multiples of 4k, the problem will never occur. This means that all devices you present need to tell the OS they have 4k sectors. I *think* you can do this by setting
blk_limits_io_min()in the driver ... but you'll have to test this. The minimum sector size gets set also insd.cwhen we probe the disk. I think that won't overrideblk_limits_io_min(), but please test (we don't have any SCSI drivers which have ever used this setting).
Quoted 4 lines
The way to test, is to read back the /sys/block/<dev>/queue/ settings when presenting a 512 byte sector disk. (And the way to activate your bounce code would be to create a filesystem with a <
PAGE_SIZEblock size).
Given that the bounce buffer handling code would typically
never be triggered, I not sure how useful it will be to try to get rid of the bounce buffer code using a feature that is not well tested. In any event, I will try your suggestion though.
Regards,
K. Y
James Bottomley
maintainerQuoted 5 lines · KY Srinivasan
This patch is against Greg's staging tree where recently I merged all of the storage
drivers into a single driver. This change may not have percolated up yet - Greg has
checked this into his staging tree though.
OK, that explains the difference.
Quoted 7 lines
As I deal with the review comments now, do you want me to get these changes
applied first to Greg's tree before you would consider moving this driver todrivers/scsi
directory, or could you move the driver as it is in Greg's tree under staging and I could give
you patches against the moved driver.
Either way is fine by me. The best route for this is to get the staging update into Linus head, then work on the actual SCSI problems. I'd like other SCSI people besides me to review it.
Quoted 14 lines
Quoted 9 lines
OK, so as I read the code, what it can't handle is fragments except at the ends. As long as everything always transfers in multiples of 4k, the problem will never occur. This means that all devices you present need to tell the OS they have 4k sectors. I *think* you can do this by setting
blk_limits_io_min()in the driver ... but you'll have to test this. The minimum sector size gets set also insd.cwhen we probe the disk. I think that won't overrideblk_limits_io_min(), but please test (we don't have any SCSI drivers which have ever used this setting).Quoted 4 lines
The way to test, is to read back the /sys/block/<dev>/queue/ settings when presenting a 512 byte sector disk. (And the way to activate your bounce code would be to create a filesystem with a <
PAGE_SIZEblock size).
Quoted 4 lines
Given that the bounce buffer handling code would typically never be triggered, I not sure how useful it will be to try to get rid of the bounce buffer
code using a feature that is not well tested.
As opposed to bounce buffer code which hasn't been well tested either if it can't be triggered.
Quoted 1 line
In any event, I will try your suggestion though.
Just to be clear: Setting the minimum I/O size is completely well
tested: it's how we handle 4k sector drives. What hasn't been tested is the ability of the *driver* to enforce the minimum using blk_limits_io_min(). As long at that doesn't get overridden by sd when it sees a 512b drive, the rest of the block paths (those which actually enforce the minimum) have all been well tested.
James
Quoted 17 lines · James Bottomley
Quoted 5 lines · KY Srinivasan
This patch is against Greg's staging tree where recently I merged all of the storage
drivers into a single driver. This change may not have percolated up yet - Greg has
checked this into his staging tree though.OK, that explains the difference.
Quoted 7 lines
As I deal with the review comments now, do you want me to get these changes
applied first to Greg's tree before you would consider moving this driver todrivers/scsi
directory, or could you move the driver as it is in Greg's tree under staging and I could give
you patches against the moved driver.
Quoted 3 lines
Either way is fine by me. The best route for this is to get the staging update into Linus head, then work on the actual SCSI problems. I'd like other SCSI people besides me to review it.
That will happen for the 3.2-rc1 release, so that might be the better time to review this.
greg k-h
Quoted 55 lines
-----Original Message-----
From: James Bottomley [mailto:[email protected]]
Sent: Monday, October 17, 2011 11:27 AM
To: KY Srinivasan
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Haiyang Zhang
Subject: RE: [PATCH 1/1] Staging: hv: storvsc: Move the storage driver out of stagingQuoted 5 lines · KY Srinivasan
This patch is against Greg's staging tree where recently I merged all of the storage
drivers into a single driver. This change may not have percolated up yet - Greg has
checked this into his staging tree though.OK, that explains the difference.
Quoted 7 lines
As I deal with the review comments now, do you want me to get these changes
applied first to Greg's tree before you would consider moving this driver todrivers/scsi
directory, or could you move the driver as it is in Greg's tree under staging and I could give
you patches against the moved driver.Either way is fine by me. The best route for this is to get the staging update into Linus head, then work on the actual SCSI problems. I'd like other SCSI people besides me to review it.
Quoted 14 lines
Quoted 9 lines
OK, so as I read the code, what it can't handle is fragments except at the ends. As long as everything always transfers in multiples of 4k, the problem will never occur. This means that all devices you present need to tell the OS they have 4k sectors. I *think* you can do this by setting
blk_limits_io_min()in the driver ... but you'll have to test this. The minimum sector size gets set also insd.cwhen we probe the disk. I think that won't overrideblk_limits_io_min(), but please test (we don't have any SCSI drivers which have ever used this setting).Quoted 4 lines
The way to test, is to read back the /sys/block/<dev>/queue/ settings when presenting a 512 byte sector disk. (And the way to activate your bounce code would be to create a filesystem with a <
PAGE_SIZEblock size).Quoted 4 lines
Given that the bounce buffer handling code would typically never be triggered, I not sure how useful it will be to try to get rid of the bounce buffer
code using a feature that is not well tested.As opposed to bounce buffer code which hasn't been well tested either if it can't be triggered.
Quoted 8 lines
Quoted 1 line
In any event, I will try your suggestion though.
Just to be clear: Setting the minimum I/O size is completely well
tested: it's how we handle 4k sector drives. What hasn't been tested is the ability of the *driver* to enforce the minimum usingblk_limits_io_min(). As long at that doesn't get overridden by sd when it sees a 512b drive, the rest of the block paths (those which actually enforce the minimum) have all been well tested.
I will work on addressing the issues you have raised and any other comments I might get from the community. I will submit these patches to Greg and I will copy you and other scsi maintainers as well. Once Greg's staging tree is synced with Linus' tree, then I will submit the code for further review in preparation for moving the code out of staging.
Regards,
K. Y
Quoted 22 lines
-----Original Message-----
From: James Bottomley [mailto:[email protected]]
Sent: Monday, October 17, 2011 11:27 AM
To: KY Srinivasan
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Haiyang Zhang
Subject: RE: [PATCH 1/1] Staging: hv: storvsc: Move the storage driver out of stagingQuoted 7 lines · KY Srinivasan
As I deal with the review comments now, do you want me to get these changes
applied first to Greg's tree before you would consider moving this driver todrivers/scsi
directory, or could you move the driver as it is in Greg's tree under staging and I could give
you patches against the moved driver.
Quoted 3 lines
Either way is fine by me. The best route for this is to get the staging update into Linus head, then work on the actual SCSI problems. I'd like other SCSI people besides me to review it.
Christoph had reviewed this code sometime back and I think I have addressed the issues he had raised. These patches have already been applied by Greg to his staging tree.
Quoted 15 lines
Quoted 14 lines
Quoted 14 lines
OK, so as I read the code, what it can't handle is fragments except at the ends. As long as everything always transfers in multiples of 4k, the problem will never occur. This means that all devices you present need to tell the OS they have 4k sectors. I *think* you can do this by setting
blk_limits_io_min()in the driver ... but you'll have to test this. The minimum sector size gets set also insd.cwhen we probe the disk. I think that won't overrideblk_limits_io_min(), but please test (we don't have any SCSI drivers which have ever used this setting).The way to test, is to read back the /sys/block/<dev>/queue/ settings when presenting a 512 byte sector disk. (And the way to activate your bounce code would be to create a filesystem with a <
PAGE_SIZEblock size).
Quoted 9 lines
Quoted 1 line
In any event, I will try your suggestion though.
Just to be clear: Setting the minimum I/O size is completely well
tested: it's how we handle 4k sector drives. What hasn't been tested is the ability of the *driver* to enforce the minimum usingblk_limits_io_min(). As long at that doesn't get overridden by sd when it sees a 512b drive, the rest of the block paths (those which actually enforce the minimum) have all been well tested.
James, I used the blk_limits_io_min() to 4k and yet I see I/O requests coming in to the driver that need to be handled with the bounce buffers. So I am not quite sure how to avoid having the bounce buffer handling code. This is with a file system with 2k block size.
Other than this, I have addressed all of your other comments. I am going to send these patches out to the staging tree. Do you want me to send out a patch moving the driver out of staging for your review as well. Let me know.
Regards,
K. Y