RE: kmalloc()'ing greater than 128k

Ingo Molnar (mingo@chiara.csoma.elte.hu)
Wed, 3 Nov 1999 14:35:33 +0100 (CET)


On Wed, 3 Nov 1999, Lee Rhodes wrote:

> > 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().
> I assume this allocates single pages (1024 bytes) and I would need to use

(single pages are 4096 bytes on x86.)

> __get_free_pages() specifying the best fit. I'll need to track the
> allocations though so when it comes to free_page()'ing I use the right
> 'order' value.

yes.

> > But vmalloc() should really work just fine, as long as you do
> > not try to DMA into it without being careful.
> No DMA involved.
>
> > What kernel shows this 'crawling' behavior?
> I'm RedHat'ing with 2.2.5-15.

could you try 2.2.13?

> > kmalloc() allocates physically continuous memory as well.
> So what are the chances of kmalloc(102400) x 3 and the three malloc'ed areas
> being continuous :)?

it's not guaranteed at all, and there are frequent 'holes' (per-slab
header information).

i believe vmalloc()/vfree() is the best choice, as long as you are not
doing this from IRQ handlers.

-- 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/