[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: large memory allocations



On Sun, Aug 05, 2001 at 09:22:17AM +0200, Hilik Stein wrote:
> Hi all
> i am trying to write a kernel module, which needs to allocate a very large
> buffer at runtime.
> i am using kmalloc, and it fails if i try to allocate more than 128K, since
> it has caches for sizes up to this size.
> is there a way to allocate more than 128k in a kernel module ?

Yes.  You could use vmalloc() (mm/vmalloc.c) to allocate a large virtually
but NOT physically contingous piece of memory.  You could try get_free_pages
with a high order, but that will probably fail once the system memory is
fragmented, so you can't rely on it.

	Christoph

-- 
Of course it doesn't work. We've performed a software upgrade.
-
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
IRC Channel:   irc.openprojects.net / #kernelnewbies
Web Page:      http://www.kernelnewbies.org/