linux_dsm_epyc7002/drivers/media/usb/pwc
Matwey V. Kornilov 1161db6776 media: usb: pwc: Don't use coherent DMA buffers for ISO transfer
DMA cocherency slows the transfer down on systems without hardware
coherent DMA.
Instead we use noncocherent DMA memory and explicit sync at data receive
handler.

Based on previous commit the following performance benchmarks have been
carried out. Average memcpy() data transfer rate (rate) and handler
completion time (time) have been measured when running video stream at
640x480 resolution at 10fps.

x86_64 based system (Intel Core i5-3470). This platform has hardware
coherent DMA support and proposed change doesn't make big difference here.

 * kmalloc:            rate = (2.0 +- 0.4) GBps
                       time = (5.0 +- 3.0) usec
 * usb_alloc_coherent: rate = (3.4 +- 1.2) GBps
                       time = (3.5 +- 3.0) usec

We see that the measurements agree within error ranges in this case.
So theoretically predicted performance downgrade cannot be reliably
measured here.

armv7l based system (TI AM335x BeagleBone Black @ 300MHz). This platform
has no hardware coherent DMA support. DMA coherence is implemented via
disabled page caching that slows down memcpy() due to memory controller
behaviour.

 * kmalloc:            rate =  ( 94 +- 4) MBps
                       time =  (101 +- 4) usec
 * usb_alloc_coherent: rate = (28.1 +- 0.1) MBps
                       time =  (341 +- 2) usec

Note, that quantative difference leads (this commit leads to 3.3 times
acceleration) to qualitative behavior change in this case. As it was
stated before, the video stream cannot be successfully received at AM335x
platforms with MUSB based USB host controller due to performance issues
[1].

[1] https://www.spinics.net/lists/linux-usb/msg165735.html

Signed-off-by: Matwey V. Kornilov <matwey@sai.msu.ru>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2019-01-16 11:16:06 -05:00
..
Kconfig
Makefile
pwc-ctrl.c Replace <asm/uaccess.h> with <linux/uaccess.h> globally 2016-12-24 11:46:01 -08:00
pwc-dec1.c
pwc-dec1.h
pwc-dec23.c media: drivers: remove "/**" from non-kernel-doc comments 2017-11-30 04:19:03 -05:00
pwc-dec23.h
pwc-if.c media: usb: pwc: Don't use coherent DMA buffers for ISO transfer 2019-01-16 11:16:06 -05:00
pwc-kiara.c
pwc-kiara.h
pwc-misc.c
pwc-nala.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
pwc-timon.c
pwc-timon.h
pwc-uncompress.c [media] media: videobuf2: Restructure vb2_buffer 2015-10-01 09:04:43 -03:00
pwc-v4l.c media: replace strcpy() by strscpy() 2018-09-11 13:32:17 -04:00
pwc.h media: replace all <spaces><tab> occurrences 2018-01-04 13:15:05 -05:00