kmem_cache_alloc makes sense when you allocate multiple objects with the
same size. It currently always uses an own page so you probably should have
more than ~2K bytes of objects at least to avoid wasting memory. It also
makes sense when your object sizes fit poorly into the power-of-2 kmalloc
sizes or when you need very fast allocation. In case your objects require
initialization it may also make sense to use the slab constructor/deconstructor
feature in this case.
kmem_cache_alloc creates less fragmentation than kmalloc because objects with
similar livetime are clustered together.
Hope this helps,
-Andi
-
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/