kernel memory allocation

Dave Hylands dhylands at gmail.com
Thu Dec 22 22:02:19 EST 2011


Hi,

On Thu, Dec 22, 2011 at 6:33 PM, J.Hwan Kim <frog1120 at gmail.com> wrote:
> Hi, everyone
>
> How can I allocated contiguous kernel memory over 128MB ?
> When I use _get_free_pages() function, it returns error.
> I guess the memory size is greater than the amount which the function
> can allocate.

You can use bootmem to reserve the memory at boot time, and then use
the bootmem allocator to alloocate from that reserved memory/

There is also some new code called CMA (Contiguous Memory Allocator)
which hasn't hit the mainline yet, but it could also be used.

See: http://lwn.net/Articles/468044/ for further details.

-- 
Dave Hylands
Shuswap, BC, Canada
http://www.davehylands.com



More information about the Kernelnewbies mailing list