Re: [RFC] kmem_cache_zalloc

From: Dipankar Sarma (dipankar@in.ibm.com)
Date: Thu Mar 28 2002 - 06:21:42 EST


In article <20020327201917.A23810@phoenix.infradead.org> Christoph Hellwig wrote:

> I'd really go for k(mem_)zalloc, but a kmem_cache_alloc leads people toward
> writing bad code. The purpose of the slab allocator is to allow caching
> readily constructed objects, a _zalloc destroys them on alloc.

I thought that the life span of an object is between
kmem_cache_alloc and kmem_cache_free. If you are expecting caching
beyond this, you may not get correct data. kmem_cache allocator
is supposed to quickly allocate fixed size structures avoiding
the need for frequent splitting and coalescing in the allocator.

Am I missing something here ?

Thanks

-- 
Dipankar Sarma  <dipankar@in.ibm.com> http://lse.sourceforge.net
Linux Technology Center, IBM Software Lab, Bangalore, India.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun Mar 31 2002 - 22:00:16 EST