linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] Hyper-V TRIM support
@ 2013-09-13 12:58 Andy Whitcroft
  2013-09-13 12:58 ` [PATCH 1/4] scsi: add scsi device flag to request VPD pages be used at SPC-2 Andy Whitcroft
                   ` (5 more replies)
  0 siblings, 6 replies; 8+ messages in thread
From: Andy Whitcroft @ 2013-09-13 12:58 UTC (permalink / raw)
  To: James E.J. Bottomley, K. Y. Srinivasan, Haiyang Zhang
  Cc: Andy Whitcroft, devel, Ben Howard, linux-scsi, linux-kernel

tl;dr -- enable TRIM support for Hyper-V emulated disks.

The Hyper-V hypervisor can support TRIM for its devices, advertising this
via the appropriate VPD pages.  However the emulated disks only claim
to be SPC-2 devices.  According to the specs VPD pages (in general) did
exist at SPC-2 but the specific pages we interogate for the TRIM support
did not until SPC-3 therefore the kernel avoids reading the relevant pages
for SPC-2 devices and prevents TRIM from being offered for these devices.
Additionally at SPC-2 we prefer ReadCapacity10 over ReadCapacity16 and
unless we use RC16 we will not identify the device as TRIM capable also
preventing TRIM being offered.

As the VPD page zero does list which pages are valid for each device, it
could be argued that we could simply attempt to use these pages for all
devices which claim to be SPC-2 and above.  While this seems valid the
code documents a number of devices which take badly to having even VPD
page 0 interogated even when supposedly supported.  Therefore it seems
appropriate to add a scsi device flag to allow a device to request SPC-3
VPD pages be used when only at SPC-2.

Similarly for the ReadCapacity selection it seems dangerous to invert
the order for all SPC-2 devices.  So it seems appropriate to add a scsi
device flag to request we try RC16 before RC10 (mirroring the existing
flag for the opposite).

The following four patches add the two scsi device flags and select those
flags for the Hyper-V emulated disks.

Patches against v3.11.

Comments?

-apw

Andy Whitcroft (4):
  scsi: add scsi device flag to request VPD pages be used at SPC-2
  scsi: add scsi device flag to request READ CAPACITY (16) be preferred
  scsi: hyper-v storage -- mark as VPD capable at SPC-2
  scsi: hyper-v storage -- mark as preferring READ CAPACITY (16) at
    SPC-2

 drivers/scsi/sd.c          | 8 +++++++-
 drivers/scsi/storvsc_drv.c | 2 ++
 include/scsi/scsi_device.h | 2 ++
 3 files changed, 11 insertions(+), 1 deletion(-)

-- 
1.8.1.2

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

end of thread, other threads:[~2013-09-13 15:41 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-13 12:58 [PATCH 0/4] Hyper-V TRIM support Andy Whitcroft
2013-09-13 12:58 ` [PATCH 1/4] scsi: add scsi device flag to request VPD pages be used at SPC-2 Andy Whitcroft
2013-09-13 12:58 ` [PATCH 2/4] scsi: add scsi device flag to request READ CAPACITY (16) be preferred Andy Whitcroft
2013-09-13 12:58 ` [PATCH 3/4] scsi: hyper-v storage -- mark as VPD capable at SPC-2 Andy Whitcroft
2013-09-13 12:58 ` [PATCH 4/4] scsi: hyper-v storage -- mark as preferring READ CAPACITY (16) " Andy Whitcroft
2013-09-13 14:57 ` [PATCH 0/4] Hyper-V TRIM support James Bottomley
2013-09-13 15:40   ` Andy Whitcroft
2013-09-13 15:40 ` Douglas Gilbert

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