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

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

 



On 5 June 2015 21:09:08 BST, Alan Stern <stern@xxxxxxxxxxxxxxxxxxx> wrote:
>On Fri, 5 Jun 2015, Mark Hills wrote:
>
>> 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"
>
>What did you use for this monitoring?  It isn't usbmon output.

It's wireshark/tshark.

Sorry, I'm new to usbmon and I wasn't able to find a 'standard' decoder.  I didn't imagine the 't' output was intended for posting to the list. Wireshark did feel like a sledgehammer, so let me know if there is a preferred format.

>> I can imagine this accounts for the lack of throughput, but not
>whether 
>> it's the cause or a symptom.
>
>It must be a symptom -- that is, it can't be the ultimate cause.  There
>
>must be a reason why the write URBs are so small; the default limit is 
>120 KB.
>
>> 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.
>
>I'm puzzled.  Have you checked /sys/block/sdc/queue/max_sectors_kb?

It's 120 on the affected system.

>Whatever the reason is, it doesn't seem to be connected with the USB 
>stack.

Ok thanks for your assistance. Unless anyone does have any ideas here, I suppose my only option is to start tracing the writes up the stack.

I recall there's also a verbose/debug kernel config to usb-storage so I might try there. But it may be days/weeks before I'm able to do this, so any suggestions in the meantime are warmly welcomed.

Thanks again


-- 
Mark
--
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