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 Thu, 22 Jul 2010 09:28:02 +0200
Marek Szyprowski <m.szyprowski@samsung.com> wrote:

> > About the framework, it looks too complicated than we actually need
> > (the command line stuff looks insane).
>
> Well, this command line stuff was designed to provide a way to configure
> memory allocation for devices with very sophisticated memory requirements.

You have the feature in the wrong place.

Your example: a camera driver and a video driver can share 20MB, then
they want 20MB exclusively.

You can reserve 20MB and make them share it. Then you can reserve 20MB
for both exclusively.

You know how the whole system works. Adjust drivers (probably, with
module parameters).


> > 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?
>
> There are a few problems with such simple approach:
>
> 1. It does not provide all required functionality for our multimedia
> devices. The main problem is the fact that our multimedia devices
> require particular kind of buffers to be allocated in particular memory
> bank. Then add 2 more requirements: a proper alignment (for some of them
> it is even 128Kb) and particular range of addresses requirement (some
> buffers must be allocated at higher addresses than the firmware).
> This is very hard to achieve with such simple allocator.

When a video driver needs 20MB to work properly, what's the point of
releasing the 20MB for others then trying to get it again later?

Even with the above example (two devices never use the memory at the
same time), the driver needs memory regularly. What's the point of
split the 20MB to small chunks and allocate them to others?


\
 
 \ /
  Last update: 2010-07-22 11:37    [W:0.112 / U:0.104 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site