lkml.org 
[lkml]   [2018]   [Aug]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH v1] media: uvcvideo: Cache URB header data before processing
On Wed, 8 Aug 2018, Keiichi Watanabe wrote:

> Hi Laurent, Kieran, Tomasz,
>
> Thank you for reviews and suggestions.
> I want to do additional measurements for improving the performance.
>
> Let me clarify my understanding:
> Currently, if the platform doesn't support coherent-DMA (e.g. ARM),
> urb_buffer is allocated by usb_alloc_coherent with
> URB_NO_TRANSFER_DMA_MAP flag instead of using kmalloc.

Not exactly. You are mixing up allocation with mapping. The speed of
the allocation doesn't matter; all that matters is whether the memory
is cached and when it gets mapped/unmapped.

> This is because we want to avoid frequent DMA mappings, which are
> generally expensive.
> However, memories allocated in this way are not cached.
>
> So, we wonder if using usb_alloc_coherent is really fast.
> In other words, we want to know which is better:
> "No DMA mapping/Uncached memory" v.s. "Frequent DMA mapping/Cached memory".

There is no need to wonder. "Frequent DMA mapping/Cached memory" is
always faster than "No DMA mapping/Uncached memory".

The only issue is that on some platform (such as x86) but not others,
there is a third option: "No DMA mapping/Cached memory". On platforms
which support it, this is the fastest option.

Alan Stern

\
 
 \ /
  Last update: 2018-08-08 16:21    [W:0.421 / U:0.208 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site