Re: SuperSpeed usb-storage, yet runs at 5Mbyte/sec

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 5 Jun 2015, Alan Stern wrote:

> On Fri, 5 Jun 2015, Mark Hills wrote:
> 
> > I have a new USB 3.0 hard drive which appears to be throttled at 
> > approx 5Mbyte/sec.
> > 
> > Is there a mystery kernel option that is required to enable full 
> > performance on these new drives?
> > 
> > I have tried changing following:
> > 
> > * Switching onboard USB 2.0 interfaces for a completely new USB 3.0 
> >   interface (xhci_pci)
> > 
> > * Enabling and disabling the "USB attached SCSI" CONFIG_USB_UAS
> > 
> > But drive performance stays limited at 5Mbyte/sec.
> > 
> > I've settled on using the USB 3.0 interface, and the dmesg (below) reports 
> > "SuperSpeed" and looks ok.
[...]
> By any chance, do you mount the filesystem with the "-o sync" option?  
> That will slow things _way_ down.

It's not -- and also I can reproduce the results with no file system;
just a 'dd' to /dev/sdc1.
 
> If that's not the answer, try acquiring usbmon traces on the fast and 
> slow systems for comparison (see the instructions in 
> Documentation/usb/usbmon.txt.).

Thanks for this -- I made some progress.

I also tested reads this time which were ok (150Mbyte/sec), it's only 
writes that appear to be throttled.

I have a sample of reads and writes from both systems below. I disabled 
'uas' for the tests, droped caches etc. and used 'dd bs=1M' to the 
partition.

The most striking thing is that the affected system consistently uses ~4KB 
URBs ("Len: 1"?) for writes.

Whereas all the other requests seem to be a majority ~60KB URBs and "Len: 
30"

I can imagine this accounts for the lack of throughput, but not whether 
it's the cause or a symptom.

The lsusb output for the device is identical on both systems (see below)

I imagine something lies in the code that generates the write requests, 
but I am starting from scratch here. I'd be greateful if you (or anyone 
else) has information that could point me to the next step.

Thanks

-- 
Mark


#
# reads on the affected system
#

  1   0.000000          4.1 -> host         USBMS 77 
  2   0.000020         host -> 4.2          USBMS 95 SCSI: Read(10) LUN: 0x00 (LBA: 0x000323c0, Len: 30)
  3   0.000040          4.2 -> host         USB 64 URB_BULK out
  4   0.000047         host -> 4.1          USB 64 URB_BULK in
  5   0.000642          4.1 -> host         USB 61504 URB_BULK in
  6   0.000689         host -> 4.1          USB 64 URB_BULK in
  7   0.000702          4.1 -> host         USBMS 77 
  8   0.000722         host -> 4.2          USBMS 95 SCSI: Read(10) LUN: 0x00 (LBA: 0x000323de, Len: 2)
  9   0.000744          4.2 -> host         USB 64 URB_BULK out
 10   0.000755         host -> 4.1          USB 64 URB_BULK in
 11   0.000811          4.1 -> host         USB 8256 URB_BULK in
 12   0.000827         host -> 4.1          USB 64 URB_BULK in
 13   0.000854          4.1 -> host         USBMS 77 
 14   0.000879         host -> 4.2          USBMS 95 SCSI: Read(10) LUN: 0x00 (LBA: 0x000323e0, Len: 30)
 15   0.000895          4.2 -> host         USB 64 URB_BULK out
 16   0.000906         host -> 4.1          USB 64 URB_BULK in


#
# writes on the affected system <------- this is the 'bad' case
#

  1   0.000000         host -> 4.2          USBMS 95 SCSI: Write(10) LUN: 0x00 (LBA: 0x000017fc, Len: 1)
  2   0.000019          4.2 -> host         USB 64 URB_BULK out
  3   0.000026         host -> 4.2          USB 4160 URB_BULK out
  4   0.000074          4.2 -> host         USB 64 URB_BULK out
  5   0.000089         host -> 4.1          USB 64 URB_BULK in
  6   0.000147          4.1 -> host         USBMS 77 
  7   0.000955         host -> 4.2          USBMS 95 SCSI: Write(10) LUN: 0x00 (LBA: 0x000017fd, Len: 1)
  8   0.000969          4.2 -> host         USB 64 URB_BULK out
  9   0.000978         host -> 4.2          USB 4160 URB_BULK out
 10   0.001027          4.2 -> host         USB 64 URB_BULK out
 11   0.001034         host -> 4.1          USB 64 URB_BULK in
 12   0.001095          4.1 -> host         USBMS 77 
 13   0.001960         host -> 4.2          USBMS 95 SCSI: Write(10) LUN: 0x00 (LBA: 0x000017fe, Len: 1)
 14   0.001979          4.2 -> host         USB 64 URB_BULK out
 15   0.001988         host -> 4.2          USB 4160 URB_BULK out
 16   0.002041          4.2 -> host         USB 64 URB_BULK out
[... continues, always using "Len: 1" and 4160 size]

#
# reads on the 'good' system
#

  1   0.000000          4.1 -> host         USB 61504 URB_BULK in
  2   0.000020         host -> 4.1          USB 64 URB_BULK in
  3   0.000042          4.1 -> host         USBMS 77 
  4   0.000100         host -> 4.2          USBMS 95 SCSI: Read(10) LUN: 0x00 (LBA: 0x0003ab7e, Len: 2)
  5   0.000113          4.2 -> host         USB 64 URB_BULK out
  6   0.000116         host -> 4.1          USB 64 URB_BULK in
  7   0.000170          4.1 -> host         USB 8256 URB_BULK in
  8   0.000174         host -> 4.1          USB 64 URB_BULK in
  9   0.000213          4.1 -> host         USBMS 77 
 10   0.000225         host -> 4.2          USBMS 95 SCSI: Read(10) LUN: 0x00 (LBA: 0x0003ab80, Len: 30)
 11   0.000251          4.2 -> host         USB 64 URB_BULK out
 12   0.000254         host -> 4.1          USB 64 URB_BULK in
 13   0.000987          4.1 -> host         USB 61504 URB_BULK in
 14   0.001004         host -> 4.1          USB 64 URB_BULK in
 15   0.001030          4.1 -> host         USBMS 77 
 16   0.001056         host -> 4.2          USBMS 95 SCSI: Read(10) LUN: 0x00 (LBA: 0x0003ab9e, Len: 2)


#
# writes on the 'good' system
#

  1   0.000000          4.2 -> host         USB 64 URB_BULK out
  2   0.000007         host -> 4.1          USB 64 URB_BULK in
  3   0.000041          4.1 -> host         USBMS 77 
  4   0.000072         host -> 4.2          USBMS 95 SCSI: Write(10) LUN: 0x00 (LBA: 0x0009ed09, Len: 30)
  5   0.000084          4.2 -> host         USB 64 URB_BULK out
  6   0.000089         host -> 4.2          USB 61504 URB_BULK out
  7   0.000702          4.2 -> host         USB 64 URB_BULK out
  8   0.000708         host -> 4.1          USB 64 URB_BULK in
  9   0.000744          4.1 -> host         USBMS 77 
 10   0.000800         host -> 4.2          USBMS 95 SCSI: Write(10) LUN: 0x00 (LBA: 0x0009ed27, Len: 30)
 11   0.000813          4.2 -> host         USB 64 URB_BULK out
 12   0.000819         host -> 4.2          USB 61504 URB_BULK out
 13   0.001420          4.2 -> host         USB 64 URB_BULK out
 14   0.001425         host -> 4.1          USB 64 URB_BULK in
 15   0.001443          4.1 -> host         USBMS 77 
 16   0.001475         host -> 4.2          USBMS 95 SCSI: Write(10) LUN: 0x00 (LBA: 0x0009ed45, Len: 30)


#
# lsusb output for the device
#

Bus 004 Device 005: ID 0bc2:a0a4 Seagate RSS LLC Backup Plus Desktop Drive
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               3.00
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0         9
  idVendor           0x0bc2 Seagate RSS LLC
  idProduct          0xa0a4 Backup Plus Desktop Drive
  bcdDevice            1.00
  iManufacturer           2 Seagate
  iProduct                3 Backup+ Desk Mac
  iSerial                 1 NA5R1K71
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength          121
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0xc0
      Self Powered
    MaxPower               36mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass         8 Mass Storage
      bInterfaceSubClass      6 SCSI
      bInterfaceProtocol     80 Bulk-Only
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0400  1x 1024 bytes
        bInterval               0
        bMaxBurst              15
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x02  EP 2 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0400  1x 1024 bytes
        bInterval               0
        bMaxBurst              15
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       1
      bNumEndpoints           4
      bInterfaceClass         8 Mass Storage
      bInterfaceSubClass      6 SCSI
      bInterfaceProtocol     98 
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0400  1x 1024 bytes
        bInterval               0
        bMaxBurst              15
        MaxStreams             32
        Data-in pipe (0x03)
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x02  EP 2 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0400  1x 1024 bytes
        bInterval               0
        bMaxBurst              15
        MaxStreams             32
        Data-out pipe (0x04)
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0400  1x 1024 bytes
        bInterval               0
        bMaxBurst              15
        MaxStreams             32
        Status pipe (0x02)
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x04  EP 4 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0400  1x 1024 bytes
        bInterval               0
        bMaxBurst               0
        Command pipe (0x01)
Binary Object Store Descriptor:
  bLength                 5
  bDescriptorType        15
  wTotalLength           22
  bNumDeviceCaps          2
  USB 2.0 Extension Device Capability:
    bLength                 7
    bDescriptorType        16
    bDevCapabilityType      2
    bmAttributes   0x00000002
      Link Power Management (LPM) Supported
  SuperSpeed USB Device Capability:
    bLength                10
    bDescriptorType        16
    bDevCapabilityType      3
    bmAttributes         0x00
    wSpeedsSupported   0x000e
      Device can operate at Full Speed (12Mbps)
      Device can operate at High Speed (480Mbps)
      Device can operate at SuperSpeed (5Gbps)
    bFunctionalitySupport   1
      Lowest fully-functional device speed is Full Speed (12Mbps)
    bU1DevExitLat          10 micro seconds
    bU2DevExitLat        2047 micro seconds
Device Status:     0x000d
  Self Powered
  U1 Enabled
  U2 Enabled
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux