lkml.org 
[lkml]   [2010]   [Jul]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH 2/4] mm: cma: Contiguous Memory Allocator added
From
On Tue, 20 Jul 2010 18:12:39 -0600
Jonathan Corbet <corbet@lwn.net> wrote:

> One other thing occurred to me as I was thinking about this...
>
> > + There are four calls provided by the CMA framework to devices. To
> > + allocate a chunk of memory cma_alloc() function needs to be used:
> > +
> > + unsigned long cma_alloc(const struct device *dev,
> > + const char *kind,
> > + unsigned long size,
> > + unsigned long alignment);
>
> The purpose behind this interface, I believe, is pretty much always
> going to be to allocate memory for DMA buffers. Given that, might it
> make more sense to integrate the API with the current DMA mapping
> API?

IMO, having separate APIs for allocating memory and doing DMA mapping
is much better. The DMA API covers the latter well. We could extend
the current API to allocate memory or create new one similar to the
current.

I don't see any benefit of a new abstraction that does both magically.


About the framework, it looks too complicated than we actually need
(the command line stuff looks insane).

Why can't we have something simpler, like using memblock to reserve
contiguous memory at boot and using kinda mempool to share such memory
between devices?


\
 
 \ /
  Last update: 2010-07-22 07:41    [from the cache]
©2003-2011 Jasper Spaans