USB performance vs governor

35 views
Skip to first unread message

Daniel Kulp

unread,
Aug 6, 2018, 7:42:35 PM8/6/18
to BeagleBoard

I'm been trying to track down why the USB performance on my BBB's has been abysmal.  I've discovered that the default on-demand governor is definitely a major contributor to the slowdown.   

Basically, with the ondemand governor, I'm seeing read performance off of a USB3 thumb drive of well under 2MB/sec.   In other words, really slow.   For example:

root@FPP:/home/fpp# uname -a
Linux FPP 4.14.60-ti-r67 #1 SMP PREEMPT Sat Aug 4 19:54:06 UTC 2018 armv7l GNU/Linux
root@FPP:/home/fpp# cpufreq-set -g ondemand
root@FPP:/home/fpp# dd if=/dev/sda1 of=/dev/null bs=1048576 count=32
32+0 records in
32+0 records out
33554432 bytes (34 MB, 32 MiB) copied, 24.9291 s, 1.3 MB/s
root@FPP:/home/fpp# dd if=/dev/sda1 of=/dev/null bs=1048576 count=32
32+0 records in
32+0 records out
33554432 bytes (34 MB, 32 MiB) copied, 22.283 s, 1.5 MB/s

  (yes.. "dd" isn't a great benchmark, but it's trivial to show the issue).  Once I switch to the performance governor, things improve quite a bit:

root@FPP:/home/fpp# cpufreq-set -g performance
root@FPP
:/home/fpp# dd if=/dev/sda1 of=/dev/null bs=1048576 count=64
64+0 records in
64+0 records out
67108864 bytes (67 MB, 64 MiB) copied, 6.96759 s, 9.6 MB/s
root@FPP
:/home/fpp# dd if=/dev/sda1 of=/dev/null bs=1048576 count=64
64+0 records in
64+0 records out
67108864 bytes (67 MB, 64 MiB) copied, 6.98015 s, 9.6 MB/s


It's still not anywhere near what a Raspberry Pi is able to do with the same thumb drive (30MB/s), but it's a huge improvement.   

Is there any setting or anything that can be used to improve the read performance of the USB besides locking the CPU at 1Ghz?

Robert Nelson

unread,
Aug 6, 2018, 8:08:26 PM8/6/18
to Beagle Board, Daniel Kulp
PERFORMANCE should be the default governor, for a long time it was on-demand..

If you know what USB devices you'll be plugging in, switch the MUSB
DMA mode from the cpu to cppi4.1 via:

diff --git a/patches/defconfig b/patches/defconfig
index 661d1a5..31a8caf 100644
--- a/patches/defconfig
+++ b/patches/defconfig
@@ -4601,7 +4601,8 @@ CONFIG_USB_MUSB_AM335X_CHILD=y
#
# MUSB DMA mode
#
-CONFIG_MUSB_PIO_ONLY=y
+# CONFIG_MUSB_PIO_ONLY is not set
+CONFIG_USB_TI_CPPI41_DMA=y
CONFIG_USB_DWC3=y
# CONFIG_USB_DWC3_HOST is not set
# CONFIG_USB_DWC3_GADGET is not set

You "will" lose compatibly with some usb devices. (most the wifi
ones..).. But for mass storage it should be fine..

Regards,

--
Robert Nelson
https://rcn-ee.com/

Daniel Kulp

unread,
Aug 6, 2018, 8:44:56 PM8/6/18
to BeagleBoard
This was with the latest debian stretch image from beaglebone.org with an updated kernel.  It seems to be using ondemand by default.   

I need wifi support as well. :(

Dan

Jason Kridner

unread,
Aug 6, 2018, 10:59:24 PM8/6/18
to beagl...@googlegroups.com, Daniel Kulp
Are there e2e bug reports for dongles that fail when DMA mode is used?

>
> Regards,
>
> --
> Robert Nelson
> https://rcn-ee.com/
>
> --
> For more options, visit http://beagleboard.org/discuss
> ---
> You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/CAOCHtYhDm93Y%2BMCUfxVSQdwZk2pgt20CqTWpcH6eNhtbC5joRw%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages