lkml.org 
[lkml]   [2014]   [Jan]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 1/5] x86: make dma_alloc_coherent() return zeroed memory if CMA is enabled
On Fri, Jan 17, 2014 at 08:34:38AM +0900, Akinobu Mita wrote:
> 2014/1/16 Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>:
> > On Tue, Jan 14, 2014 at 11:13:46PM +0900, Akinobu Mita wrote:
> >> Calling dma_alloc_coherent() with __GFP_ZERO must return zeroed memory.
> >>
> >> But when the contiguous memory allocator (CMA) is enabled on x86 and
> >> the memory region is allocated by dma_alloc_from_contiguous(), it
> >> doesn't return zeroed memory. Because dma_generic_alloc_coherent()
> >
> > So why not fix it there to return zeroed out memory?
>
> I thought it looked nicer than this patch as we can remove memset
> from all caller of dma_alloc_from_contiguous(). But if I look at
> the caller on arm, we can't simply remove the memset because
> __dma_clear_buffer() is used there for ensuring cache flushing and
> it is used in many places.

OK, that should be part of the commit description.
>
> Of course we can do redundant memset in dma_alloc_from_contiguous(),
> but now I think this patch is less impact for fixing this problem.

OK.


\
 
 \ /
  Last update: 2014-01-24 19:41    [W:0.668 / U:0.012 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site