lkml.org 
[lkml]   [2002]   [Apr]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] kmem_cache_zalloc()
Tommy Reynolds wrote:
>
> Uttered "Eric Sandeen" <sandeen@sgi.com>, spoke thus:
>
> > In short, we're using a kmem_cache_zalloc() function in XFS which just
> > does kmem_cache_alloc + memset.
> >
> > We'd like to incorporate this into the kernel proper, and several others
> > chimed in that it would be useful, so here's the patch. If it's a no-go
> > with you, we can roll this functionality back under fs/xfs to reduce our
> > changes in the mainline kernel.
>
> Why not use the constructor function interface to kmem_cache_create that is
> _already_ in the kernel API?

Constructors are only called once when the slab is allocated. It is
expected that objects are returned to the slab in the same state.

I think a better idea would be to add a flag to the cache that tells
kmem_cache_alloc() to zero out the object it allocates instead of
creating another interface.

--

Brian Gerst
-
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/

\
 
 \ /
  Last update: 2005-03-22 13:25    [W:0.309 / U:0.128 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site