Re: kmalloc() allocation.

From: Tigran Aivazian (tigran@veritas.com)
Date: Mon Oct 30 2000 - 11:38:35 EST


On Mon, 30 Oct 2000, Richard B. Johnson wrote:
> > So, if you don't need physically contiguous (and fast) allocations perhaps
> > you could make use of vmalloc()/vfree() instead? There must be also some
> > "exotic" allocation APIs like bootmem but I know nothing of them so I stop
> > here.
>
> Okay. Looks like I need a linked-list so I can use noncontiguous memory.

Just to remind, I was talking of physically and not just virtually
contiguous. vmalloc will still give you a virtually-contiguous chunk. But
if by "I need a linked-list" you mean that each node of the list may be
talking to some hardware but the hardware won't know about the whole list,
then you still need to use physically-contiguous allocator like
__get_free_pages() for each data node, i.e. if your hardware actually
needs physically contiguous chunk to talk to. Also, in this case, using
vmalloc() to allocate just the "linkage/admin overhead" is silly, just
using kmalloc or even creating a private slab object cache is probably a
better idea.

Regards,
Tigran

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



This archive was generated by hypermail 2b29 : Tue Oct 31 2000 - 21:00:27 EST