Re: [PATCH/RFCv4 0/6] The Contiguous Memory Allocator framework

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Hans Verkuil
Date: Saturday, August 28, 2010 - 6:08 am

On Thursday, August 26, 2010 00:58:14 Andrew Morton wrote:

Yes, indeed. And you have to be careful as well how you move pages around.
Say that you have a capture and an output v4l device: the first one needs
64 MB contiguous memory and so it allocates that amount, moving pages around
as needed. Once allocated that memory is pinned in place since it is needed
for DMA. So if the output device also needs 64 MB, then you must have a
guarantee that the first allocation didn't fragment the available contiguous
memory.

I also wonder how expensive it is to move all the pages around. E.g. if you
have a digital camera and want to make a hires picture, then it wouldn't
do if it takes a second to move all the pages around making room for the
captured picture. The CPUs in many SoCs are not very powerful compared to
your average desktop.

And how would memory allocations in specific memory ranges (e.g. memory
banks) work?

Note also that these issues are not limited to embedded systems, also PCI(e)
boards can sometimes require massive amounts of DMA-able memory. I have had
this happen in the past with the ivtv driver with customers that had 15 or so
capture cards in one box. And I'm sure it will happen in the future as well,
esp. with upcoming 4k video formats.

Video is a major memory consumer, particularly in embedded systems. And there
usually is no room for failure.


It's not really that weird. The same problems can actually occur as well
with the more 'mainstream' consumer level video boards, although you need
more extreme environments for these problems to surface.


I'm doing the reviewing for linux-media. It would be really nice to have a
good system for this in place. For example, the current TI davinci capture
driver will only work reliably (memory-wise) if you also use the out-of-tree
TI cmem module. Hardly a desirable situation. Basically a fair amount of
custom hacks is required at the memory to have reliable video streaming on
embedded systems due to the lack of a cma-type framework.


The video subsystem is the other candidate. Probably not for the current generation
of GPUs (these all have hardware IOMMUs I suspect), but definitely for the framebuffer
based devices that are often present on SoCs.

Regards,

	Hans
 

-- 
Hans Verkuil - video4linux developer - sponsored by TANDBERG, part of Cisco
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH/RFCv4 0/6] The Contiguous Memory Allocator framework, Michal Nazarewicz, (Fri Aug 20, 2:50 am)
[PATCH/RFCv4 1/6] lib: rbtree: rb_root_init() function added, Michal Nazarewicz, (Fri Aug 20, 2:50 am)
[PATCH/RFCv4 2/6] mm: cma: Contiguous Memory Allocator added, Michal Nazarewicz, (Fri Aug 20, 2:50 am)
[PATCH/RFCv4 3/6] mm: cma: Added SysFS support, Michal Nazarewicz, (Fri Aug 20, 2:50 am)
[PATCH/RFCv4 4/6] mm: cma: Added command line parameters s ..., Michal Nazarewicz, (Fri Aug 20, 2:50 am)
[PATCH/RFCv4 5/6] mm: cma: Test device and application added, Michal Nazarewicz, (Fri Aug 20, 2:50 am)
[PATCH/RFCv4 6/6] arm: Added CMA to Aquila and Goni, Michal Nazarewicz, (Fri Aug 20, 2:50 am)
Re: [PATCH/RFCv4 2/6] mm: cma: Contiguous Memory Allocator ..., Konrad Rzeszutek Wilk, (Wed Aug 25, 1:32 pm)
Re: [PATCH/RFCv4 3/6] mm: cma: Added SysFS support, Konrad Rzeszutek Wilk, (Wed Aug 25, 1:37 pm)
Re: [PATCH/RFCv4 0/6] The Contiguous Memory Allocator fram ..., KAMEZAWA Hiroyuki, (Wed Aug 25, 5:58 pm)
Re: [PATCH/RFCv4 3/6] mm: cma: Added SysFS support, Michał Nazarewicz, (Wed Aug 25, 6:20 pm)
Re: [PATCH/RFCv4 2/6] mm: cma: Contiguous Memory Allocator ..., Michał Nazarewicz, (Wed Aug 25, 6:22 pm)
Re: [PATCH/RFCv4 0/6] The Contiguous Memory Allocator fram ..., Michał Nazarewicz, (Wed Aug 25, 6:28 pm)
Re: [PATCH/RFCv4 0/6] The Contiguous Memory Allocator fram ..., Michał Nazarewicz, (Wed Aug 25, 6:38 pm)
Re: [PATCH/RFCv4 0/6] The Contiguous Memory Allocator fram ..., Michał Nazarewicz, (Wed Aug 25, 6:49 pm)
Re: [PATCH/RFCv4 0/6] The Contiguous Memory Allocator fram ..., Michał Nazarewicz, (Wed Aug 25, 7:12 pm)
Re: [PATCH/RFCv4 0/6] The Contiguous Memory Allocator fram ..., Michał Nazarewicz, (Wed Aug 25, 7:40 pm)
Re: [PATCH/RFCv4 0/6] The Contiguous Memory Allocator fram ..., KAMEZAWA Hiroyuki, (Wed Aug 25, 7:50 pm)
Re: [PATCH/RFCv4 0/6] The Contiguous Memory Allocator fram ..., KAMEZAWA Hiroyuki, (Wed Aug 25, 8:44 pm)
Re: [PATCH/RFCv4 0/6] The Contiguous Memory Allocator fram ..., Michał Nazarewicz, (Wed Aug 25, 9:01 pm)
Re: [PATCH/RFCv4 0/6] The Contiguous Memory Allocator fram ..., KAMEZAWA Hiroyuki, (Wed Aug 25, 9:30 pm)
Re: [PATCH/RFCv4 0/6] The Contiguous Memory Allocator fram ..., KAMEZAWA Hiroyuki, (Wed Aug 25, 9:39 pm)
[PATCH/RFCv4.1 2/6] mm: cma: Contiguous Memory Allocator added, Michal Nazarewicz, (Wed Aug 25, 11:25 pm)
Re: [PATCH/RFCv4 2/6] mm: cma: Contiguous Memory Allocator ..., Michał Nazarewicz, (Thu Aug 26, 7:09 pm)
Re: [PATCH/RFCv4 0/6] The Contiguous Memory Allocator fram ..., Michał Nazarewicz, (Thu Aug 26, 7:41 pm)
Re: [PATCH/RFCv4 0/6] The Contiguous Memory Allocator fram ..., KAMEZAWA Hiroyuki, (Fri Aug 27, 1:16 am)
Re: [PATCH/RFCv4 0/6] The Contiguous Memory Allocator fram ..., Hans Verkuil, (Sat Aug 28, 6:08 am)
Re: [PATCH/RFCv4 2/6] mm: cma: Contiguous Memory Allocator ..., Michał Nazarewicz, (Sat Aug 28, 6:48 pm)