On Sat, Nov 6, 2010 at 2:09 AM, Rajat Sharma fs.ra...@gmail.com wrote:
as i know,kmalloc is based on kmem_cache_alloc ,so what's the different?
kmalloc uses the generic slab caches available to any kernel code. so your
module will share slab cache with other components in kernel, but if you
Unless you are creating your own subsystem(or complex driver) and will
be responsible for allocating a lot of one specific data structure
there is no reason to create your own cache. Even in the driver case
you will often know ahead of time the number of data structures to
preallocate and
thanks for all your guys, it's very clear . It's helpful
Can you also explain when to use alloc_pages ? I wanna know in what case to
use it in drivers. thanks again .
as i know,kmalloc is based on kmem_cache_alloc ,so what's the different?
kmalloc uses the generic slab caches available to
Can you also explain when to use alloc_pages ? I wanna know in what
case to use it in drivers.
alloc_pages is zone allocator which implements buddy allocation algorithm.
It is the basic allocation API. Following is the dependency call sequence:
kmalloc() -- kmem_cahce_alloc() -- alloc_pages()
as i know,kmalloc is based on kmem_cache_alloc ,so what's the different?
kmalloc uses the generic slab caches available to any kernel code. so your
module will share slab cache with other components in kernel, but if you
specifically want a better slab cache management dedicated to your module
Hi...
On Fri, Nov 5, 2010 at 10:03, kernel.niko kernel.n...@gmail.com wrote:
hi,everyone,
I'm wandering how to use kmalloc and kmem_cache_alloc.
as i know,kmalloc is based on kmem_cache_alloc ,so what's the different?
when to use kmalloc? and
in what occasion,kmem_cache_alloc should be used?
On Thu, Nov 4, 2010 at 8:03 PM, kernel.niko kernel.n...@gmail.com wrote:
hi,everyone,
I'm wandering how to use kmalloc and kmem_cache_alloc.
as i know,kmalloc is based on kmem_cache_alloc ,so what's the different?
kmalloc should be used when you want to allocate byte sized memory as
opposed to
hi,everyone,
I'm wandering how to use kmalloc and kmem_cache_alloc.
as i know,kmalloc is based on kmem_cache_alloc ,so what's the different? when
to use kmalloc? and
in what occasion,kmem_cache_alloc should be used?
thanks.
2010-11-05
kernel.niko