USB stack
blubee blubeeme
gurenchan at gmail.com
Sun Jan 7 10:09:09 UTC 2018
On Sun, Jan 7, 2018 at 5:35 PM, Mark Millard <markmi at dsl-only.net> wrote:
> blubee blubeeme gurenchan at gmail.com wrote on
> Wed Jan 3 10:31:56 UTC 2018 :
>
> > Does FreeBSD current USB stack support usb >= 2.0 devices?
> >
> > Testing out the USB devices support I get about 7.2-7.8 megabytes per
> > second which seems odd.
>
>
> FreeBSD machine: Pine64+ 2GB? Ryzen Threadripper 1950X? . . .?
>
> It would help to specify the type of system and its
> relevant properties (not just the processor).
>
> What independent channels are in use? Any? Or are
> the source and destination on the same channel at
> some stage?
>
> > I transferred about 30GB of audio from laptop
>
> The 30GB was on what type of device? Plugged in to what?
> What file system?
>
ZFS file system on the main machine and the 1TB Transcend drive.
I am not 100% sure what format android device is;
I can look into this further but I've been testing on the Transcend device
linked above in this list.
>
> > to Samsung usb class 10 usb
> > device connected to LG v30.
>
> What file system?
>
Android 7.1
>
> And in another message (indicating the other direction
> of transfer compared to the above?):
>
I transfer from the phone to the computer.
>
> > I use the phone, LG V30 to record basically ungraded RAW video files to
> the
> > microsd card; they are large files.
> > I transfer them to my computer copy a backup to the 1TB driver; then do
> > edits/ color grading, etc in blender,
> > then I transfer the finished to another 1TB hdd for backup as well.
>
> So the LG v30 was plugged in as a USB device, effectively
> acting as a media reader/writer? What file system?
> (It seems unlikely that the LG v30 would use a FreeBSD
> native file system to record RAW video files.)
>
>
> Going the other direction of providing some examples
> of files copies for UFS. . .
>
> Note: These are based on head -r327485 with
> non-debug kernel builds.
>
>
> Example performance copying /usr/src/ :
> (lots of small files on a fairly low-end FreeBSD
> machine)
>
> RPi2B V1.1 (with USB 2.0)
> One USB 3.0 powered hub (USB 2.0 compatible) with both:
>
> A) USB 3.0 SSD stick (USB 2.0 compatible) with the root file system
>
> B) 64 GB eMMC on a usdcard adapter, plugged into a USB 3.0 media
> reader/writer (USB 2.0 compatible).
>
> mount -o noatime in use for (A) and (B). UFS file systems.
> soft-updates enabled.
>
> cp -ax /usr/src/ /mnt/root/srccpy_test
>
> gstat -pd outputs, a few examples:
>
> dT: 1.007s w: 1.000s
> L(q) ops/s r/s kBps ms/r w/s kBps ms/w d/s kBps
> ms/d %busy Name
> 0 255 255 5501 1.9 0 0 0.0 0 0
> 0.0 48.0| da0
> 0 0 0 0 0.0 0 0 0.0 0 0
> 0.0 0.0| da1
> 0 0 0 0 0.0 0 0 0.0 0 0
> 0.0 0.0| da2
> 0 0 0 0 0.0 0 0 0.0 0 0
> 0.0 0.0| da3
> 64 426 1 32 221.4 425 6287 140.4 0 0
> 0.0 62.9| da4
>
> Note that the read kBps + write kBps means around 11MiByte/s for r+w.
> (There is only one USB connection at the RPi2B V1.1 here,
> not multiple, independent channels.)
>
This is an example copying [multiple small files] to the 1TB drive.
------------------------------------------------------------------------------------------------------------------
L(q) ops/s r/s kBps ms/r w/s kBps ms/w d/s kBps
ms/d %busy Name
0 547 290 35239 2.0 4 16 73.1 249 44291
93.7 48.8| nvd0
0 0 0 0 0.0 0 0 0.0 0 0
0.0 0.0| md99
21 333 0 0 0.0 333 36040 16.2 0 0
0.0 76.2| da1
------------------------------------------------------------------------------------------------------------------
>
> dT: 1.007s w: 1.000s
> L(q) ops/s r/s kBps ms/r w/s kBps ms/w d/s kBps
> ms/d %busy Name
> 0 393 393 5295 1.3 0 0 0.0 0 0
> 0.0 50.7| da0
> 0 0 0 0 0.0 0 0 0.0 0 0
> 0.0 0.0| da1
> 0 0 0 0 0.0 0 0 0.0 0 0
> 0.0 0.0| da2
> 0 0 0 0 0.0 0 0 0.0 0 0
> 0.0 0.0| da3
> 46 102 2 64 2.9 100 2101 116.9 0 0
> 0.0 19.5| da4
>
> The above last shows a period with around 7 MiBytes/s for r+w.
>
> dT: 1.007s w: 1.000s
> L(q) ops/s r/s kBps ms/r w/s kBps ms/w d/s kBps
> ms/d %busy Name
> 16 245 245 9761 37.4 0 0 0.0 0 0
> 0.0 77.4| da0
> 0 0 0 0 0.0 0 0 0.0 0 0
> 0.0 0.0| da1
> 0 0 0 0 0.0 0 0 0.0 0 0
> 0.0 0.0| da2
> 0 0 0 0 0.0 0 0 0.0 0 0
> 0.0 0.0| da3
> 28 481 0 0 0.0 481 10809 95.1 0 0
> 0.0 93.7| da4
>
> That last shows a period with around 20 MiBytes/s for r+w.
> (Probably copying fewer, bigger files at the time.)
>
> This might be around 8 MiBytes/s being written (mean rate
> overall for the copy).
>
>
> Example high end machine copying /usr/src/ to
> fast USB 3.0 SSD stick over USB 3.0, all UFS
> file system based:
>
> Ryzen Threadripper 1950X
> Running FreeBSD under Hyper-V under Windows 10 Pro
> Samsung 960 Pro 1TB NVMe root root UFS file system
> USB 3.0 SSD stick (USB 2.0 compatible) on a USB 3.0 connection (UFS)
> (These are Hyper-V "Physical disk drive" bindings,
> not NTFS files used as a virtual file system.)
>
> mount -o noatime in use for both. UFS file systems.
> soft-updates.
>
> cp -ax /usr/src/ /mnt/root/srccpy_test
>
> gstat -pd outputs, a couple of examples:
>
> dT: 1.023s w: 1.000s
> L(q) ops/s r/s kBps ms/r w/s kBps ms/w d/s kBps
> ms/d %busy Name
> 0 0 0 0 0.0 0 0 0.0 0 0
> 0.0 0.0| fd0
> 0 6519 6519 103339 0.1 0 0 0.0 0 0
> 0.0 35.5| da0
> 0 0 0 0 0.0 0 0 0.0 0 0
> 0.0 0.0| da1
> 0 0 0 0 0.0 0 0 0.0 0 0
> 0.0 0.0| da2
> 0 0 0 0 0.0 0 0 0.0 0 0
> 0.0 0.0| cd0
> 676 6635 0 0 0.0 6635 119898 43.6 0 0
> 0.0 43.0| da3
>
> dT: 1.058s w: 1.000s
> L(q) ops/s r/s kBps ms/r w/s kBps ms/w d/s kBps
> ms/d %busy Name
> 0 0 0 0 0.0 0 0 0.0 0 0
> 0.0 0.0| fd0
> 0 6839 6839 106968 0.1 0 0 0.0 0 0
> 0.0 34.7| da0
> 0 0 0 0 0.0 0 0 0.0 0 0
> 0.0 0.0| da1
> 0 0 0 0 0.0 0 0 0.0 0 0
> 0.0 0.0| da2
> 0 0 0 0 0.0 0 0 0.0 0 0
> 0.0 0.0| cd0
> 1 6967 0 0 0.0 6967 133410 42.4 0 0
> 0.0 46.1| da3
>
> In this context there are 2 independent channels
> and reading from one and writing from the other
> can potentially happen at the same time.
>
> Vastly faster than 8 MiBytes/s mean rate for writes.
>
>
> Example high end machine copying /usr/src/ from
> and to fast USB 3.0 SSD sticks over USB 3.0, all
> UFS file system based:
>
> Ryzen Threadripper 1950X
> Running FreeBSD under Hyper-V under Windows 10 Pro
> USB 3.0 SSD stick (USB 2.0 compatible) on a USB 3.0 connection (UFS)
> Another USB 3.0 SSD stick (USB 2.0 compatible) on a USB 3.0 connection
> (UFS)
> (These are Hyper-V "Physical disk drive" bindings,
> not NTFS files used as a virtual file system.)
>
> mount -o noatime in use for both. UFS file systems.
> soft-updates.
>
> cp -ax /mnt/usr/src /media/root/srccpy_test
>
> gstat -pd outputs, a couple of examples:
>
> dT: 1.008s w: 1.000s
> L(q) ops/s r/s kBps ms/r w/s kBps ms/w d/s kBps
> ms/d %busy Name
> 0 0 0 0 0.0 0 0 0.0 0 0
> 0.0 0.0| fd0
> 0 0 0 0 0.0 0 0 0.0 0 0
> 0.0 0.0| da0
> 0 0 0 0 0.0 0 0 0.0 0 0
> 0.0 0.0| da1
> 0 0 0 0 0.0 0 0 0.0 0 0
> 0.0 0.0| da2
> 1 2388 2388 36317 0.3 0 0 0.0 0 0
> 0.0 80.5| da3
> 0 2197 0 0 0.0 2197 38206 35.7 0 0
> 0.0 14.8| da4
> 0 0 0 0 0.0 0 0 0.0 0 0
> 0.0 0.0| cd0
>
> dT: 1.070s w: 1.000s
> L(q) ops/s r/s kBps ms/r w/s kBps ms/w d/s kBps
> ms/d %busy Name
> 0 0 0 0 0.0 0 0 0.0 0 0
> 0.0 0.0| fd0
> 0 0 0 0 0.0 0 0 0.0 0 0
> 0.0 0.0| da0
> 0 0 0 0 0.0 0 0 0.0 0 0
> 0.0 0.0| da1
> 0 0 0 0 0.0 0 0 0.0 0 0
> 0.0 0.0| da2
> 1 2443 2443 44537 0.3 0 0 0.0 0 0
> 0.0 82.5| da3
> 0 2309 0 0 0.0 2309 51142 36.0 0 0
> 0.0 18.7| da4
> 0 0 0 0 0.0 0 0 0.0 0 0
> 0.0 0.0| cd0
>
> dT: 1.070s w: 1.000s
> L(q) ops/s r/s kBps ms/r w/s kBps ms/w d/s kBps
> ms/d %busy Name
> 0 0 0 0 0.0 0 0 0.0 0 0
> 0.0 0.0| fd0
> 0 0 0 0 0.0 0 0 0.0 0 0
> 0.0 0.0| da0
> 0 0 0 0 0.0 0 0 0.0 0 0
> 0.0 0.0| da1
> 0 0 0 0 0.0 0 0 0.0 0 0
> 0.0 0.0| da2
> 0 2664 2664 65516 0.3 0 0 0.0 0 0
> 0.0 82.8| da3
> 0 2932 0 0 0.0 2932 84290 34.5 0 0
> 0.0 32.2| da4
> 0 0 0 0 0.0 0 0 0.0 0 0
> 0.0 0.0| cd0
>
> dT: 1.047s w: 1.000s
> L(q) ops/s r/s kBps ms/r w/s kBps ms/w d/s kBps
> ms/d %busy Name
> 0 0 0 0 0.0 0 0 0.0 0 0
> 0.0 0.0| fd0
> 0 0 0 0 0.0 0 0 0.0 0 0
> 0.0 0.0| da0
> 0 0 0 0 0.0 0 0 0.0 0 0
> 0.0 0.0| da1
> 0 0 0 0 0.0 0 0 0.0 0 0
> 0.0 0.0| da2
> 1 2542 2542 28571 0.3 0 0 0.0 0 0
> 0.0 77.7| da3
> 778 1803 13 428 0.4 1789 15985 27.8 0 0
> 0.0 8.0| da4
> 0 0 0 0 0.0 0 0 0.0 0 0
> 0.0 0.0| cd0
>
> I doubt that this has independent channels at
> all stages.
>
> Faster than 8 MiBytes/s mean rate for writes.
>
>
>
> Example high end machine copying /usr/src/ from
> and to fast USB 3.0 SSD sticks over USB 2.0, all
> UFS file system based:
>
> Ryzen Threadripper 1950X
> Running FreeBSD under Hyper-V under Windows 10 Pro
> USB 3.0 SSD stick (USB 2.0 compatible) on a USB 2.0 connection (UFS)
> Another USB 3.0 SSD stick (USB 2.0 compatible) on a USB 2.0 connection
> (UFS)
> (These are Hyper-V "Physical disk drive" bindings,
> not NTFS files used as a virtual file system.)
>
> mount -o noatime in use for both. UFS file systems.
> soft-updates.
>
> cp -ax /mnt/usr/src /media/root/srccpy_test
>
> gstat -pd outputs, a couple of examples:
>
> dT: 1.070s w: 1.000s
> L(q) ops/s r/s kBps ms/r w/s kBps ms/w d/s kBps
> ms/d %busy Name
> 0 0 0 0 0.0 0 0 0.0 0 0
> 0.0 0.0| fd0
> 0 0 0 0 0.0 0 0 0.0 0 0
> 0.0 0.0| da0
> 0 0 0 0 0.0 0 0 0.0 0 0
> 0.0 0.0| da1
> 0 0 0 0 0.0 0 0 0.0 0 0
> 0.0 0.0| da2
> 1 812 812 10487 0.8 0 0 0.0 0 0
> 0.0 62.6| da3
> 0 0 0 0 0.0 0 0 0.0 0 0
> 0.0 0.0| cd0
> 0 949 5 150 66.9 944 13853 229.0 0 0
> 0.0 48.6| da4
>
> dT: 1.042s w: 1.000s
> L(q) ops/s r/s kBps ms/r w/s kBps ms/w d/s kBps
> ms/d %busy Name
> 0 0 0 0 0.0 0 0 0.0 0 0
> 0.0 0.0| fd0
> 0 0 0 0 0.0 0 0 0.0 0 0
> 0.0 0.0| da0
> 0 0 0 0 0.0 0 0 0.0 0 0
> 0.0 0.0| da1
> 0 0 0 0 0.0 0 0 0.0 0 0
> 0.0 0.0| da2
> 1 1093 1093 12903 0.7 0 0 0.0 0 0
> 0.0 71.5| da3
> 0 0 0 0 0.0 0 0 0.0 0 0
> 0.0 0.0| cd0
> 180 1003 8 246 94.9 996 9443 242.7 0 0
> 0.0 35.9| da4
>
> dT: 1.068s w: 1.000s
> L(q) ops/s r/s kBps ms/r w/s kBps ms/w d/s kBps
> ms/d %busy Name
> 0 0 0 0 0.0 0 0 0.0 0 0
> 0.0 0.0| fd0
> 0 0 0 0 0.0 0 0 0.0 0 0
> 0.0 0.0| da0
> 0 0 0 0 0.0 0 0 0.0 0 0
> 0.0 0.0| da1
> 0 0 0 0 0.0 0 0 0.0 0 0
> 0.0 0.0| da2
> 1 617 617 15973 1.4 0 0 0.0 0 0
> 0.0 87.4| da3
> 0 0 0 0 0.0 0 0 0.0 0 0
> 0.0 0.0| cd0
> 1 1147 2 60 49.2 1145 17220 187.0 0 0
> 0.0 78.1| da4
>
> Still solidly more than 8 MiBytes/s being written (mean rate).
>
>
> Having a few large files to copy instead should normally
> be faster in each of the earlier example contexts.
>
> But no hard drives or flash drives were involved: all SSDs of
> one form or another. Hard drive properties and file system
> fragmentation could make things much slower by comparison.
> Flash drives also can have issues.
>
> This is a larger file, not the largest but hey
L(q) ops/s r/s kBps ms/r w/s kBps ms/w d/s kBps
ms/d %busy Name
0 4 0 0 0.0 2 8 0.0 0 0
0.0 0.1| nvd0
0 0 0 0 0.0 0 0 0.0 0 0
0.0 0.0| md99
128 982 1 32 58.8 981 125428 110.5 0 0
0.0 100.0| da1
===
> Mark Millard
> markmi at dsl-only.net
>
> I'm having a few issues with USB but just to simplify things;
let's focus on speed for the device that I am currently using.
Device spec:
FreeBSD blubee 12.0-CURRENT FreeBSD 12.0-CURRENT #0 r326056: Tue Nov 21
14:54:55 UTC 2017
root at releng3.nyi.freebsd.org:/usr/obj/usr/src/amd64.amd64/sys/GENERIC
amd64
pciconf -lv
hostb0 at pci0:0:0:0: class=0x060000 card=0x6a011558 chip=0x19108086 rev=0x07
hdr=0x00
vendor = 'Intel Corporation'
device = 'Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor Host
Bridge/DRAM Registers'
class = bridge
subclass = HOST-PCI
pcib1 at pci0:0:1:0: class=0x060400 card=0x6a011558 chip=0x19018086 rev=0x07
hdr=0x01
vendor = 'Intel Corporation'
device = 'Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor PCIe
Controller (x16)'
class = bridge
subclass = PCI-PCI
xhci0 at pci0:0:20:0: class=0x0c0330 card=0x6a011558 chip=0xa12f8086 rev=0x31
hdr=0x00
vendor = 'Intel Corporation'
device = 'Sunrise Point-H USB 3.0 xHCI Controller'
class = serial bus
subclass = USB
none0 at pci0:0:22:0: class=0x078000 card=0x6a011558 chip=0xa13a8086 rev=0x31
hdr=0x00
vendor = 'Intel Corporation'
device = 'Sunrise Point-H CSME HECI'
class = simple comms
ahci0 at pci0:0:23:0: class=0x010601 card=0x6a011558 chip=0xa1038086 rev=0x31
hdr=0x00
vendor = 'Intel Corporation'
device = 'Sunrise Point-H SATA Controller [AHCI mode]'
class = mass storage
subclass = SATA
pcib2 at pci0:0:28:0: class=0x060400 card=0x6a011558 chip=0xa1108086 rev=0xf1
hdr=0x01
vendor = 'Intel Corporation'
device = 'Sunrise Point-H PCI Express Root Port'
class = bridge
subclass = PCI-PCI
pcib3 at pci0:0:28:4: class=0x060400 card=0x6a011558 chip=0xa1148086 rev=0xf1
hdr=0x01
vendor = 'Intel Corporation'
device = 'Sunrise Point-H PCI Express Root Port'
class = bridge
subclass = PCI-PCI
pcib4 at pci0:0:28:6: class=0x060400 card=0x6a011558 chip=0xa1168086 rev=0xf1
hdr=0x01
vendor = 'Intel Corporation'
device = 'Sunrise Point-H PCI Express Root Port'
class = bridge
subclass = PCI-PCI
pcib5 at pci0:0:29:0: class=0x060400 card=0x6a011558 chip=0xa1188086 rev=0xf1
hdr=0x01
vendor = 'Intel Corporation'
device = 'Sunrise Point-H PCI Express Root Port'
class = bridge
subclass = PCI-PCI
isab0 at pci0:0:31:0: class=0x060100 card=0x6a011558 chip=0xa14e8086 rev=0x31
hdr=0x00
vendor = 'Intel Corporation'
device = 'Sunrise Point-H LPC Controller'
class = bridge
subclass = PCI-ISA
none1 at pci0:0:31:2: class=0x058000 card=0x6a011558 chip=0xa1218086 rev=0x31
hdr=0x00
vendor = 'Intel Corporation'
device = 'Sunrise Point-H PMC'
class = memory
hdac0 at pci0:0:31:3: class=0x040300 card=0x6a021558 chip=0xa1708086 rev=0x31
hdr=0x00
vendor = 'Intel Corporation'
device = 'Sunrise Point-H HD Audio'
class = multimedia
subclass = HDA
none2 at pci0:0:31:4: class=0x0c0500 card=0x6a011558 chip=0xa1238086 rev=0x31
hdr=0x00
vendor = 'Intel Corporation'
device = 'Sunrise Point-H SMBus'
class = serial bus
subclass = SMBus
vgapci0 at pci0:1:0:0: class=0x030000 card=0x6a021558 chip=0x1ba110de rev=0xa1
hdr=0x00
vendor = 'NVIDIA Corporation'
device = 'GP104M [GeForce GTX 1070 Mobile]'
class = display
subclass = VGA
none3 at pci0:109:0:0: class=0xff0000 card=0x6a011558 chip=0x528710ec rev=0x01
hdr=0x00
vendor = 'Realtek Semiconductor Co., Ltd.'
device = 'RTL8411B PCI Express Card Reader'
re0 at pci0:109:0:1: class=0x020000 card=0x6a011558 chip=0x816810ec rev=0x12
hdr=0x00
vendor = 'Realtek Semiconductor Co., Ltd.'
device = 'RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller'
class = network
subclass = ethernet
iwm0 at pci0:110:0:0: class=0x028000 card=0x50108086 chip=0x095a8086 rev=0x48
hdr=0x00
vendor = 'Intel Corporation'
device = 'Wireless 7265'
class = network
nvme0 at pci0:111:0:0: class=0x010802 card=0x390a8086 chip=0xf1a58086 rev=0x03
hdr=0x00
vendor = 'Intel Corporation'
class = mass storage
subclass = NVM
I have the 1TB Transcend drive that I linked before [ZFS format]
I have a LG v30 with 256GB Samsung microsd.
I do not transfer to multiple USB devices at any one time.
I either transfer from phone [LG v30] to this machine; [pciconf output
above]
Transfer from this machine to 1TB USB device for backup.
I never have two or more USB devices connected to this machine.
More information about the freebsd-current
mailing list