Re: kmalloc()'ing greater than 128k

Ingo Molnar (mingo@chiara.csoma.elte.hu)
Wed, 3 Nov 1999 13:29:59 +0100 (CET)


On Wed, 3 Nov 1999, Lee Rhodes wrote:

> Hi all,
> We have encountered a situation where we require about 190k of data in
> kernel space. We tried to use vmalloc() but the machine crawls for a few
> minutes before regaining consciousness.

Indeed the maximum kmalloc() size is 128k. The maximum size of page
allocations in 2.2 & 2.3 is 2MB, you should use __get_free_page() &
free_page(). But vmalloc() should really work just fine, as long as you do
not try to DMA into it without being careful. What kernel shows this
'crawling' behavior? vmalloc() has the advantage over gfp() that it does
not necesserily allocate physically continuous pages. (and thus it's less
likely to fail on low memory machines)

get_free_page allocates 4k,8k,16k...128k, 256k blocks, if this is too
wasteful for you then you might want to extend mm/slab.c to allow bigger
kmalloc() sizes. kmalloc() allocates physically continuous memory as well.

-- mingo

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/