Thread (27 messages) flat view 27 messages, 7 authors, 2008-08-02

Re: how to allocate 9MB of memory in kernel ?

From: Timur Tabi <hidden>
Date: 2008-07-18 14:57:46

Misbah khan wrote:
4. Now we want our 9MB SDRAM to point to the kernel circular buffer we want
our circular buffer to be mapped to continues paged so that we could map it
to user space.
Physically contiguous or virtually contiguous?  I think you only need the 
buffer to be virtually contiguous, which vmalloc gives you.  You only need it 
to be physically contiguous if you are passing this buffer to hardware via DMA 
(and the hardware cannot handle scatter/gather).

If you need it to be physically contiguous, you'll have to use a function like 
alloc_pages() (or the new alloc_pages_exact, which will be in 2.6.27).  To 
allocate 9MB, you'll need to increase CONFIG_FORCE_MAX_ZONEORDER to 12.

-- 
Timur Tabi
Linux Kernel Developer @ Freescale
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help