All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] dwc2: Speed up the interrupt handler quite a bit
@ 2015-11-04 22:53 ` Douglas Anderson
  0 siblings, 0 replies; 15+ messages in thread
From: Douglas Anderson @ 2015-11-04 22:53 UTC (permalink / raw)
  To: John Youn, balbi
  Cc: Yunzhi Li, Heiko Stübner, linux-rockchip, Julius Werner,
	gregory.herrero, yousaf.kaukab, dinguyen, Douglas Anderson,
	johnyoun, gregkh, linux-usb, linux-kernel

The dwc2 interrupt handler is quite slow.  On rk3288 with a few things
plugged into the ports and with cpufreq locked at 696MHz (to simulate
real world idle system), I can easily observe dwc2_handle_hcd_intr()
taking > 120 us, sometimes > 150 us.  Note that SOF interrupts come
every 125 us with high speed USB, so taking > 120 us in the interrupt
handler is a big deal.

The patches here will speed up the interrupt controller significantly.
After this series, I have a hard time seeing the interrupt controller
taking > 20 us and I don't ever see it taking > 30 us ever in my tests
unless I bring the cpufreq back down.  With the cpufreq at 126 MHz I can
still see the interrupt handler take > 50 us, so I'm sure we could
improve this further.  ...but hey, it's a start.

In addition to the speedup, this series also has the advantage of
simplifying dwc2 and making it more like everyone else (introducing the
possibility of future simplifications).  Picking this series up will
help your diffstat and likely win you friends.  ;)

===

Steps for gathering data with ftrace:

cd /sys/devices/system/cpu/cpu0/cpufreq/
echo userspace > scaling_governor
echo 696000 > scaling_setspeed

cd /sys/kernel/debug/tracing
echo 0 > tracing_on
echo "" > trace
echo nop > current_tracer
echo function_graph > current_tracer
echo dwc2_handle_hcd_intr > set_graph_function
echo dwc2_handle_common_intr >> set_graph_function
echo dwc2_handle_hcd_intr > set_ftrace_filter
echo dwc2_handle_common_intr >> set_ftrace_filter
echo funcgraph-abstime > trace_options
echo 70 > tracing_thresh
echo 1 > /sys/kernel/debug/tracing/tracing_on

sleep 2
cat trace

===

NOTE: This series doesn't replace any other patches I've submitted
recently, it merely adds another set of changes that upstream could
benefit from.


Douglas Anderson (3):
  usb: dwc2: rockchip: Make the max_transfer_size automatic
  usb: dwc2: host: Giveback URB in tasklet context
  usb: dwc2: host: Get aligned DMA in a more supported way

 drivers/usb/dwc2/core.c      |  21 +-----
 drivers/usb/dwc2/hcd.c       | 170 ++++++++++++++++++++-----------------------
 drivers/usb/dwc2/hcd.h       |  10 ---
 drivers/usb/dwc2/hcd_intr.c  |  65 -----------------
 drivers/usb/dwc2/hcd_queue.c |   7 +-
 drivers/usb/dwc2/platform.c  |   2 +-
 6 files changed, 85 insertions(+), 190 deletions(-)

-- 
2.6.0.rc2.230.g3dd15c0


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

end of thread, other threads:[~2015-11-07 15:09 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-04 22:53 [PATCH 0/3] dwc2: Speed up the interrupt handler quite a bit Douglas Anderson
2015-11-04 22:53 ` Douglas Anderson
2015-11-04 22:53 ` [PATCH 1/3] usb: dwc2: rockchip: Make the max_transfer_size automatic Douglas Anderson
2015-11-04 22:53 ` [PATCH 2/3] usb: dwc2: host: Giveback URB in tasklet context Douglas Anderson
2015-11-04 22:53   ` Douglas Anderson
2015-11-05  0:30   ` Doug Anderson
2015-11-05  0:30     ` Doug Anderson
2015-11-05 15:19     ` Alan Stern
2015-11-06  0:29       ` Doug Anderson
2015-11-06 15:40         ` Alan Stern
2015-11-07  1:26           ` Doug Anderson
2015-11-07 15:09             ` Alan Stern
2015-11-04 22:53 ` [PATCH 3/3] usb: dwc2: host: Get aligned DMA in a more supported way Douglas Anderson
2015-11-05 19:18 ` [PATCH 0/3] dwc2: Speed up the interrupt handler quite a bit Heiko Stuebner
2015-11-05 19:18   ` Heiko Stuebner

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.