On Thu, 2002-04-25 at 03:41, Christoph Hellwig wrote:
> I don't think kmem_cache_zalloc is a good idea. The idea behind the slab
> cache is to allow object reuse by storing constructed objects in the
> caches, and a memset directly after the alloc destroys the object state.
> A kmen_zalloc/kzalloc might make more sense.
The constructor is one part of it, but what about more efficient memory
use? If we let things fall into the default power-of-two caches, we'd
waste quite a lot of memory.
See http://oss.sgi.com/~sandeen/slabinfo.html for example.
On this machine we'd use 30% more memory by using kmem_alloc vs
kmem_cache_alloc.
-Eric
-- Eric Sandeen XFS for Linux http://oss.sgi.com/projects/xfs sandeen@sgi.com SGI, Inc.- 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/